LunarPresentation/Expressions/Expression.cs

(开头部分) 35KB

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

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Xml;
using SHomeWorkshop.LunarPresentation.Adorners;
using SHomeWorkshop.LunarPresentation.Widegets;

namespace SHomeWorkshop.LunarPresentation.Expressions
{
    public abstract class Expression : AdornerDecorator, INotifyPropertyChanged
    {
        private string exID = string.Empty;

        /// <summary>
        /// 获取每个公式都需要有一个唯一标识符,这是为了撤销。
        /// 只有在“重做”时,才应该使用NewExID()方法来设置这个属性的值。
        /// </summary>
        public string ExID
        {
            get { return exID; }
        }

        /// <summary>
        /// 重设一个公式的ID。用于粘贴公式后,避免与源公式ExID重复。
        /// </summary>
        /// <param name="exID">传入ExID。</param>
        /// <returns></returns>
        public bool NewExID(string exID)
        {
            this.exID = exID;
            if (this.xmlData != null)
            {
                if (this.exID != null && this.exID.Length > 0)
                {
                    this.xmlData.SetAttribute("ExID", exID.ToString());
                    return true;
                }
            }
            return false;
        }

        public void LoadXmlExID()
        {
            if (this.xmlData == null) return;

            XmlAttribute attrExid = this.xmlData.GetAttribute("ExID");
            if (attrExid != null)
            {
                this.exID = attrExid.Value;
            }
        }

        public Expression(SubPanel rootPanel, SubPanel parentPanel, Editor editor)
        {
后面还有 980 行代码,解锁后查看完整代码

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

AI 解读 AI

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

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