LunarPresentation/Commands/SetTaskItemType.cs
(完整代码) 1KBusing System.Windows;
using System.Windows.Controls;
namespace SHomeWorkshop.LunarPresentation.Commands
{
public partial class Command
{
public static void SetTaskItemType(Expressions.BaseText.TaskType newTaskType)
{
if (Globals.selectedEditor == null) return;
if (Globals.selectedEditor.SelectedExpression == null) return;
LunarPresentation.Expressions.Expression curEx
= Globals.selectedEditor.SelectedExpression;
if (curEx is Expressions.BaseText == false)
{
MessageBox.Show("请先选中一个文本块!", Globals.appName,
MessageBoxButton.OK, MessageBoxImage.Warning);
return;
}
Expressions.BaseText bt = curEx as Expressions.BaseText;
if (bt.Indent <= 0)
{
MessageBox.Show("要设置为任务列表项的文本块至少要有一级左缩进!", Globals.appName,
MessageBoxButton.OK, MessageBoxImage.Warning);
return;
}
if (bt.ParentPanel == null || bt.ParentPanel.BasePanel.Orientation == Orientation.Horizontal)
{
MessageBox.Show("必须是垂直指向的子面板中的文本块才可以设置为任务列表项!", Globals.appName,
MessageBoxButton.OK, MessageBoxImage.Warning);
return;
}
if (bt.TaskItemType != newTaskType)
{
ModifingItem mi = new ModifingItem();
Action act = new Action(bt.ExID, -1, bt.GetType().Name, "TaskItemType",
bt.TaskItemType.ToString(), newTaskType.ToString());
bt.TaskItemType = newTaskType;
mi.Add(act);
bt.Editor.Do(mi);
bt.Editor.IsModified = true;
}
}
}
}
24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明
AI 解读 AI
登录后可用,每次 10 算力,解读结果公开显示在下面。
还没有人解读过这个文件。