LunarPresentation/Expressions/SubPanel.cs

(开头部分) 22KB

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

using System;
using System.ComponentModel;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Media;
using System.Xml;
using SHomeWorkshop.LunarPresentation.Interfaces;

namespace SHomeWorkshop.LunarPresentation.Expressions
{
    public class SubPanel : StackPanelExpression, IDirection
    {
        /// <summary>
        /// 构造子面板实例。
        /// </summary>
        /// <param name="rootPanel">根面板。</param>
        /// <param name="parentPanel">父面板。注意:子面板通常不能独立存在。
        /// 除根面板独立存在之外,其它情况下总是嵌入其它公式中,因此此处应总是传入null。</param>
        /// <param name="editor">所在编辑器</param>
        /// <param name="parentExpression">所在公式。作根面板时为null。</param>
        public SubPanel(SubPanel rootPanel, SubPanel parentPanel,
            Editor editor, Expression parentExpression)
            : base(rootPanel, parentPanel, editor)
        {
            this.MaxWidth = double.MaxValue;//导出公式图前会检查这个值。
            this.VerticalAlignment = System.Windows.VerticalAlignment.Stretch;
            this.parentExpression = parentExpression;

            this.chineseName = "子面板";
            //this.selectAdorner.IsSubPanel = true;

            // 阻止子面板被拖动。
            this.SelectAdorner.Cursor = System.Windows.Input.Cursors.Arrow;
            this.SelectAdorner.MouseLeftButtonDown +=
                new System.Windows.Input.MouseButtonEventHandler(selectAdorner_MouseLeftButtonDown);

            //重绘树型线。
            this.mainBorder.SizeChanged += new SizeChangedEventHandler(mainBorder_SizeChanged);
        }

        void mainBorder_SizeChanged(object sender, SizeChangedEventArgs e)
        {
            RefreshTreeLinesOfHeaderText();
        }

        //子面板不应支持此事件,故为null。
        void selectAdorner_MouseLeftButtonDown(object sender, System.Windows.Input.MouseButtonEventArgs e)
        {
            Globals.dragSourceExpression = null;
        }

        public override string ChineseName
        {
            get
            {
                if (this.RootPanel != null && this.RootPanel != this)
                {
                    return chineseName;
                }
后面还有 579 行代码,解锁后查看完整代码

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

AI 解读 AI

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

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