LunarPresentation/Commands/BoldAndItalic.cs

(开头部分) 5KB

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

using System.Windows;

namespace SHomeWorkshop.LunarPresentation.Commands
{
    public partial class Command
    {
        public static bool Bold()
        {
            if (Globals.selectedEditor == null) return false;
            if (Globals.selectedEditor.SelectedExpression == null) return false;

            if (Globals.selectedEditor.SelectedExpression is Expressions.BaseText)
            {
                Expressions.BaseText bt = Globals.selectedEditor.SelectedExpression as Expressions.BaseText;

                Action action = null;

                if (bt.FontWeight == FontWeights.Normal)
                {
                    action = new Action(bt.ExID, -1, bt.GetType().Name, "FontWeight",
                        bt.FontWeight.ToString(), FontWeights.Bold.ToString());
                    bt.FontWeight = FontWeights.Bold;
                }
                else
                {
                    action = new Action(bt.ExID, -1, bt.GetType().Name, "FontWeight",
                              bt.FontWeight.ToString(), FontWeights.Normal.ToString());
                    bt.FontWeight = FontWeights.Normal;
                }

                if (action != null)
                {
                    ModifingItem mi = new ModifingItem();
                    mi.Add(action);
                    bt.Editor.Do(mi);
                }

                return true;
            }
            else if (Globals.selectedEditor.SelectedExpression is Expressions.MarkText)
            {
                Expressions.MarkText mt = Globals.selectedEditor.SelectedExpression as Expressions.MarkText;

                Action action = null;

                if (mt.FontWeight == FontWeights.Normal)
                {
                    action = new Action(mt.ExID, -1, mt.GetType().Name, "FontWeight",
                        mt.FontWeight.ToString(), FontWeights.Bold.ToString());
                    mt.FontWeight = FontWeights.Bold;
                }
                else
                {
                    action = new Action(mt.ExID, -1, mt.GetType().Name, "FontWeight",
                              mt.FontWeight.ToString(), FontWeights.Normal.ToString());
                    mt.FontWeight = FontWeights.Normal;
                }

                if (action != null)
                {
后面还有 85 行代码,解锁后查看完整代码

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

AI 解读 AI

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

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