LunarPresentation/Commands/EditMarkText.cs

(开头部分) 2KB

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

using SHomeWorkshop.LunarPresentation.Dialogs;

namespace SHomeWorkshop.LunarPresentation.Commands
{
    public partial class Command
    {
        public static void EditMarkText(Expressions.Expression curEx)
        {
            Expressions.MarkText mt = curEx as Expressions.MarkText;

            MarkTextEditor meditor = new MarkTextEditor()
            {
                TopMarkText = mt.TopMarkText,
                BottomMarkText = mt.BottomMarkText,
                Owner = curEx.Editor.ParentWindow
            };

            if (meditor.ShowDialog() == true)
            {
                #region 准备“撤销”与“重做”数据。
                ModifingItem mi = new ModifingItem();
                Action actionOfTopMarkText = new Action(mt.ExID,
                    mt.ParentPanel.BasePanel.Children.IndexOf(mt),
                    typeof(Expressions.MarkText).Name,
                    "TopMarkText", mt.TopMarkText, meditor.TopMarkText);
                mi.Add(actionOfTopMarkText);

                Action actionOfBottomMarkText = new Action(mt.ExID,
                    mt.ParentPanel.BasePanel.Children.IndexOf(mt),
                    typeof(Expressions.MarkText).Name,
                    "BottomMarkText", mt.BottomMarkText, meditor.BottomMarkText);
                mi.Add(actionOfBottomMarkText);
                #endregion

                mt.TopMarkText = meditor.TopMarkText;
                mt.BottomMarkText = meditor.BottomMarkText;

                //加入“撤销”列表。
                mt.Editor.Do(mi);
            }
        }

        /// <summary>
        /// 交换上下标式的上、下标文本。
        /// </summary>
        public static void SwitchMarks()
        {
            if (Globals.selectedEditor == null || Globals.selectedEditor.SelectedExpression == null) return;
            if (Globals.selectedEditor.SelectedExpression is Expressions.MarkText == false) return;

            Expressions.MarkText mt = Globals.selectedEditor.SelectedExpression as Expressions.MarkText;

            ModifingItem mi = new ModifingItem() { OldSelectedExID = mt.ExID, NewSelectedExID = mt.ExID };

            string tmp = mt.TopMarkText;

            Action actTopMark = new Action(mt.ExID, -1, mt.GetType().Name, "TopMarkText", mt.TopMarkText,
                mt.BottomMarkText);

            mt.TopMarkText = mt.BottomMarkText;
后面还有 14 行代码,解锁后查看完整代码

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

AI 解读 AI

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

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