LunarPresentation/Editor.cs

(开头部分) 60KB

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

using System;
using System.ComponentModel;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;
using System.Xml;
using SHomeWorkshop.LunarPresentation.Adorners;
using SHomeWorkshop.LunarPresentation.Expressions;
using SHomeWorkshop.LunarPresentation.Widegets;

namespace SHomeWorkshop.LunarPresentation
{
    public class Editor : TabItem, INotifyPropertyChanged
    {
        /// <summary>
        /// 新建一个编辑器。
        /// </summary>
        /// <param name="parentWindow">传入程序主窗口。</param>
        /// <param name="xmlDocument">如果此参数为默认值(null)则会自动新建一个。</param>
        public Editor(MainWindow parentWindow, XmlDocument xmlDocument = null)
        {
            this.ParentWindow = parentWindow;
            this.SnapsToDevicePixels = true;

            this.baseScrolledViewer = new ScrollViewer()
            {
                //IsDeferredScrollingEnabled = true,
                VerticalScrollBarVisibility = ScrollBarVisibility.Auto,
                HorizontalScrollBarVisibility = ScrollBarVisibility.Auto
            };

            this.baseScrolledViewer.PreviewKeyDown
                += new System.Windows.Input.KeyEventHandler(baseScrolledViewer_PreviewKeyDown);

            //鼠标滚轮事件
            this.baseScrolledViewer.PreviewMouseWheel
                += new System.Windows.Input.MouseWheelEventHandler(baseScrolledViewer_PreviewMouseWheel);

            this.baseScrolledViewer.Background = defaultBackground;

            this.baseScrolledViewer.SizeChanged += new SizeChangedEventHandler(baseScrolledViewer_SizeChanged);

            //鼠标右键卷动
            //鼠标移动事件
            this.baseScrolledViewer.PreviewMouseRightButtonDown +=
                new MouseButtonEventHandler(baseScrolledViewer_PreviewMouseRightButtonDown);
            this.baseScrolledViewer.PreviewMouseRightButtonUp +=
                new MouseButtonEventHandler(baseScrolledViewer_PreviewMouseRightButtonUp);
            this.baseScrolledViewer.PreviewMouseMove +=
                new MouseEventHandler(baseScrolledViewer_PreviewMouseMove);

            #region 初始化选项卡头的文件名和只读标记、文档被修改标记、关闭选项卡(表示关闭文档)按钮。
            StackPanel panel = new StackPanel();

            panel.Orientation = Orientation.Horizontal;

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

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

AI 解读 AI

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

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