LunarPresentation/Commands/SelectLeft.cs

(开头部分) 3KB

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

using System.Windows.Controls;

namespace SHomeWorkshop.LunarPresentation.Commands
{
    public partial class Command
    {
        public static void SelectLeft()
        {
            if (Globals.selectedEditor == null) return;

            //正常模式,选取公式。
            if (Globals.selectedEditor.SelectedExpression == null)
            {
                if (Globals.selectedEditor.RootPanel != null)
                {
                    Globals.selectedEditor.SelectedExpression
                        = Globals.selectedEditor.RootPanel;
                }

                return;
            }

            LunarPresentation.Expressions.Expression curEx
                = Globals.selectedEditor.SelectedExpression;

            if (curEx is Expressions.SubPanel)
            {
                Expressions.SubPanel subPanel = curEx as Expressions.SubPanel;
                Expressions.SubPanel leftPanel = subPanel.LeftSubPanel;
                if (leftPanel != null)
                {
                    curEx.Editor.SelectedExpression = leftPanel;
                }
                else
                {
                    if (subPanel.ParentExpression != null)
                    {
                        curEx.Editor.SelectedExpression = subPanel.ParentExpression;
                    }
                }
                return;
            }

            if (curEx.Parent is StackPanel)
            {
                StackPanel spanel = curEx.Parent as StackPanel;

                if (spanel.Orientation == Orientation.Horizontal)
                {
                    int curIndex = spanel.Children.IndexOf(curEx);
                    if (curIndex > 0)
                    {
                        if (spanel.Children[curIndex - 1] is Expressions.Expression)
                        {
                            curEx.Editor.SelectedExpression = spanel.Children[curIndex - 1] as Expressions.Expression;
                        }
                    }
                    else
                    {
                        if (spanel.Parent is Border)
后面还有 33 行代码,解锁后查看完整代码

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

AI 解读 AI

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

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