LunarMind/FixedTitle.cs

(开头部分) 8KB

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

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Controls;
using System.Windows;
using System.Xml;
using System.Windows.Input;

namespace SHomeWorkshop.LunarMind
{
    public class FixedTitle : Title
    {
        public FixedTitle(MainWindow editor, Title masterTitle = null)
            : base(editor)
        {
            isFixed = true;
            this.MainTextBlock.Cursor = Cursors.SizeAll;
            index = -1;

            //collapseAdorner.Visibility = Visibility.Hidden;//装饰器会处理,总是不显示。

            if (masterTitle != null)
            {
                this.HigherLevelTitleID = masterTitle.ID;
            }

            this.MainTextBlock.PreviewMouseLeftButtonDown +=
                new System.Windows.Input.MouseButtonEventHandler(MainTextBlock_PreviewMouseLeftButtonDown);
            this.MainTextBlock.PreviewMouseLeftButtonUp +=
                new System.Windows.Input.MouseButtonEventHandler(MainTextBlock_PreviewMouseLeftButtonUp);

            this.CommentTextBlock.PreviewMouseLeftButtonDown +=
                new System.Windows.Input.MouseButtonEventHandler(CommentTextBlock_PreviewMouseLeftButtonDown);
            this.CommentTextBlock.PreviewMouseLeftButtonUp +=
                new System.Windows.Input.MouseButtonEventHandler(CommentTextBlock_PreviewMouseLeftButtonUp);
        }

        void CommentTextBlock_PreviewMouseLeftButtonUp(object sender, System.Windows.Input.MouseButtonEventArgs e)
        {
            SetNewLocation();
        }

        void CommentTextBlock_PreviewMouseLeftButtonDown(object sender, System.Windows.Input.MouseButtonEventArgs e)
        {
            Globals.MainWindow.isDraggingFixedTitle = true;

            Point mousePoint = e.GetPosition(Globals.MainWindow.mainCanvas);

            Globals.MainWindow.SetFixedTitleDraggingSize(
                new Point(mousePoint.X - this.leftTop.X, mousePoint.Y - this.leftTop.Y));
        }

        void MainTextBlock_PreviewMouseLeftButtonUp(object sender, System.Windows.Input.MouseButtonEventArgs e)
        {
            SetNewLocation();
        }

        private void SetNewLocation()
        {
后面还有 200 行代码,解锁后查看完整代码

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

AI 解读 AI

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

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