LunarMind/Dialogs/BaseTextEditor.xaml.cs

(开头部分) 5KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

using System;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;

namespace SHomeWorkshop.LunarMind.Dialogs
{
    /// <summary>
    /// Interaction logic for BaseTextEditor.xaml
    /// </summary>
    public partial class BaseTextEditor : Window
    {
        public BaseTextEditor(bool selectAllTextWhenLoaded = false)
        {
            InitializeComponent();
            inputTextBox.ContextMenu = null;
            inputTextBox.Focus();

            this.selectAllWhenLoaded = selectAllTextWhenLoaded;

            InputMethod.SetIsInputMethodEnabled(inputTextBox, true);

            //给边框添加变色效果,结果发现有打扰人的反面效果,于是改成只闪动两次。
            //Brush myBrush = new SolidColorBrush();

            //ColorAnimation myColorAnimation = new ColorAnimation();

            //myColorAnimation.From = Colors.Transparent;

            //myColorAnimation.To = Colors.DarkCyan;
            //myColorAnimation.Duration = new Duration(TimeSpan.FromMilliseconds(200));
            //myColorAnimation.AutoReverse = true;
            //myColorAnimation.RepeatBehavior = new RepeatBehavior(2);

            ////将动画应用到画刷(Brush)的“Color”属性。
            //myBrush.BeginAnimation(SolidColorBrush.ColorProperty, myColorAnimation);
            //outBorder.BorderBrush = myBrush;
        }

        private void Button_Click(object sender, RoutedEventArgs e)
        {
            inputTextBox.SelectedText = (sender as Button).Content.ToString();
            inputTextBox.SelectionStart += 1;
            inputTextBox.SelectionLength = 0;
        }

        private void btnOk_Click(object sender, RoutedEventArgs e)
        {
            this.DialogResult = true;
            this.Close();
        }

        private void inputTextBox_KeyDown(object sender, KeyEventArgs e)
        {
            bool isShift = false;

            KeyboardDevice kd = e.KeyboardDevice;

后面还有 103 行代码,解锁后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明

AI 解读 AI

登录后可用,每次 10 算力,解读结果公开显示在下面。

还没有人解读过这个文件。