LunarPresentation/Dialogs/BaseTextEditor.xaml.cs
(开头部分) 8KB这里只显示每个文件的开头 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.LunarPresentation.Dialogs
{
/// <summary>
/// Interaction logic for BaseTextEditor.xaml
/// </summary>
public partial class BaseTextEditor : Window
{
public BaseTextEditor()
{
InitializeComponent();
inputTextBox.ContextMenu = null;
inputTextBox.Focus();
Globals.SwitchInputMethod(true);
if (Globals.selectedEditor != null)
{
if (Globals.selectedEditor.DefaultBackground == Brushes.Transparent)
{
outBorder.Background = Brushes.WhiteSmoke;
}
else
{
outBorder.Background = Globals.selectedEditor.DefaultBackground;
}
editorTitleBorder.BorderBrush =
editorTitle.Foreground = Globals.selectedEditor.DefaultForeground;
}
InputMethod.SetIsInputMethodEnabled(inputTextBox, true);
//给边框添加变色效果,结果发现有打扰人的反面效果,于是改成只闪动两次。
Brush myBrush = new SolidColorBrush();
ColorAnimation myColorAnimation = new ColorAnimation();
if (Globals.selectedEditor != null &&
Globals.selectedEditor.ExSelectionAdornerBrush is SolidColorBrush)
{
myColorAnimation.From = ((SolidColorBrush)Globals.selectedEditor.ExSelectionAdornerBrush).Color;
}
else
{
myColorAnimation.From = Colors.Red;
}
myColorAnimation.To = Colors.Transparent;
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;
后面还有 182 行代码,解锁后查看完整代码
24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明
AI 解读 AI
登录后可用,每次 10 算力,解读结果公开显示在下面。
还没有人解读过这个文件。