LunarPresentation/Expressions/Bracket.cs

(开头部分) 15KB

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

using System;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Media;
using System.Xml;
using SHomeWorkshop.LunarPresentation.Interfaces;
using SHomeWorkshop.LunarPresentation.Widegets;

namespace SHomeWorkshop.LunarPresentation.Expressions
{
    public class Bracket : MSExpression, IDirection, ICollapsed
    {
        public Bracket(SubPanel rootPanel, SubPanel parentPanel, Editor editor)
            : base(rootPanel, parentPanel, editor)
        {
            // 基类构造方法会调用“InitializeMSPanels”这个虚方法。
            this.SizeChanged += new SizeChangedEventHandler(Bracket_SizeChanged);

            this.chineseName = "括弧式";

            bPanel.MouseLeftButtonDown +=
                new System.Windows.Input.MouseButtonEventHandler(bPanel_MouseLeftButtonDown);
            bPanel.MouseLeftButtonUp +=
                new System.Windows.Input.MouseButtonEventHandler(bPanel_MouseLeftButtonUp);

            bPanel.MouseRightButtonDown += new System.Windows.Input.MouseButtonEventHandler(bPanel_MouseRightButtonDown);
        }

        void bPanel_MouseRightButtonDown(object sender, System.Windows.Input.MouseButtonEventArgs e)
        {
            if (Editor == null) return;
            Editor.SelectedExpression = this;
            e.Handled = true;
        }

        void bPanel_MouseLeftButtonUp(object sender, System.Windows.Input.MouseButtonEventArgs e)
        {
            // 接收拖动来的公式。
            Globals.DropExpression(this);
        }

        void bPanel_MouseLeftButtonDown(object sender, System.Windows.Input.MouseButtonEventArgs e)
        {
            if (Editor == null) return;
            Editor.SelectedExpression = this;

            //准备拖动公式。
            Globals.dragSourceExpression = this;
            e.Handled = true;
        }

        private BracketPanel bPanel;

        public BracketPanel BPanel
        {
            get { return bPanel; }
        }

        public Orientation Direction
        {
后面还有 383 行代码,解锁后查看完整代码

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

AI 解读 AI

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

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