LunarPresentation/Expressions/Arrow.cs

(开头部分) 6KB

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

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

namespace SHomeWorkshop.LunarPresentation.Expressions
{
    public class Arrow : Expression
    {
        public Arrow(SubPanel rootPanel, SubPanel parentPanel, Editor editor)
            : base(rootPanel, parentPanel, editor)
        {
            aPanel = new ArrowPanel(this);
            if (parentPanel != null && parentPanel.Direction == Orientation.Horizontal)
            {
                aPanel.MinHeight = 40;
                aPanel.MinWidth = 20;
                aPanel.Width = 20;
                aPanel.Height = double.NaN;
            }
            else
            {
                aPanel.MinHeight = 20;
                aPanel.MinWidth = 40;
                aPanel.Height = 20;
                aPanel.Width = double.NaN;
            }
            aPanel.Foreground = ExForeground;

            aPanel.MouseDown += new System.Windows.Input.MouseButtonEventHandler(aPanel_MouseDown);
            aPanel.MouseLeftButtonUp += new System.Windows.Input.MouseButtonEventHandler(aPanel_MouseLeftButtonUp);

            aPanel.HorizontalAlignment = HorizontalAlignment.Stretch;
            aPanel.VerticalAlignment = VerticalAlignment.Stretch;
            this.mainBorder.Child = aPanel;
            this.mainBorder.Background = Brushes.Transparent;
            this.HorizontalAlignment = HorizontalAlignment.Stretch;
            this.VerticalAlignment = VerticalAlignment.Stretch;

            this.chineseName = "箭头";
        }

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

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

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

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

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

AI 解读 AI

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

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