1 В избранное 0 Ответвления 0

OSCHINA-MIRROR/lunarsf-Lunar-Markdown-Editor

Присоединиться к Gitlife
Откройте для себя и примите участие в публичных проектах с открытым исходным кодом с участием более 10 миллионов разработчиков. Приватные репозитории также полностью бесплатны :)
Присоединиться бесплатно
Это зеркальный репозиторий, синхронизируется ежедневно с исходного репозитория.
Клонировать/Скачать
TextCommandItem.cs 2.1 КБ
Копировать Редактировать Исходные данные Просмотреть построчно История
LunarSF Отправлено 8 лет назад 25f1ba7
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Input;
namespace LunarSF.SHomeWorkshop.LunarMarkdownEditor
{
/// <summary>
/// 文本命令的类型,主要包括:纯文本、需要使用Regex匹配的命令。
/// </summary>
public enum TextCommandType
{
NormalText, //普通纯文本命令
RegexText, //需要用正则表达式匹配的命令(例如重复3次某命令)
}
/// <summary>
/// 这个类是用来模拟 Vim 的命令模式所需要的。
/// </summary>
public class TextCommandItem
{
/// <summary>
/// 构造TextCommandItem对象。
/// </summary>
/// <param name="commandText">命令文本。</param>
/// <param name="type">命令类别:应是“纯文本、需要正则表达式解析的文本”三类之一。</param>
/// <param name="description">命令描述。</param>
public TextCommandItem(string commandText, TextCommandType type, string description = "")
{
this.CommandText = commandText;
this.Type = type;
this.Description = description;
}
private ModifierKeys modifierKeys = ModifierKeys.None;
/// <summary>
/// 功能键状态。
/// </summary>
public ModifierKeys ModifierKeys
{
get { return modifierKeys; }
set { modifierKeys = value; }
}
/// <summary>
/// 命令文本。
/// </summary>
public string CommandText { get; set; }
/// <summary>
/// 命令文本的类型。
/// </summary>
public TextCommandType Type { get; set; } = TextCommandType.NormalText;
/// <summary>
/// 命令描述文本。
/// </summary>
public string Description { get; set; } = "";
/// <summary>
/// 要执行的方法。
/// </summary>
public RunTextCommand Run { get; set; }
}
public delegate bool RunTextCommand(TextCommandItem item);
}

Комментарий ( 0 )

Вы можете оставить комментарий после Вход в систему

1
https://gitlife.ru/oschina-mirror/lunarsf-Lunar-Markdown-Editor.git
git@gitlife.ru:oschina-mirror/lunarsf-Lunar-Markdown-Editor.git
oschina-mirror
lunarsf-Lunar-Markdown-Editor
lunarsf-Lunar-Markdown-Editor
v0.4-beta8