public PrependLines(TextContext textContext, string prefix) : base(textContext) { _prefix = prefix; }
protected SelectionCommand(TextContext textContext) { TextContext = textContext; }
private void AfterCommandModifiedSelection(TextContext newText) { CurrentSelection = newText.CurrentSelection; if (newText.HasTextToAppend) _publisher.Publish(new AppendTextUiMsg(newText.TextToAppend)); _gestureSvcFactory().RemoveInputBindings(_commandKeysScope); _commandKeysScope = null; SelectionCommands.Clear(); ShowSelectionBar = false; }
public IEnumerable<IVisibleCommand> GetCommands(TextContext selectionText) { yield return new EncloseSelectionInSomething(selectionText, "__") { CommandText = "Bold", CommandIcon = "/Thawmadoce;component/Media/format_text_bold.png", KeyCombination = new KeyCombo(Key.B, ModifierKeys.Control | ModifierKeys.Shift) }; yield return new EncloseSelectionInSomething(selectionText, "_") { CommandText = "Emphasis", CommandIcon = "/Thawmadoce;component/Media/format_text_italic.png", KeyCombination = new KeyCombo(Key.E, ModifierKeys.Control | ModifierKeys.Shift) }; yield return new EncloseSelectionInSomething(selectionText, "<sub>", "</sub>") { CommandText = "Subscript", CommandIcon = "/Thawmadoce;component/Media/format_text_subscript.png", KeyCombination = new KeyCombo(Key.I, ModifierKeys.Control | ModifierKeys.Shift) }; yield return new EncloseSelectionInSomething(selectionText, "<sup>", "</sup>") { CommandText = "Superscript", CommandIcon = "/Thawmadoce;component/Media/format_text_superscript.png", KeyCombination = new KeyCombo(Key.P, ModifierKeys.Control | ModifierKeys.Shift) }; yield return new EncloseSelectionInSomething(selectionText, "<u>", "</u>") { CommandText = "Underline", CommandIcon = "/Thawmadoce;component/Media/format_text_underline.png", KeyCombination = new KeyCombo(Key.U, ModifierKeys.Control | ModifierKeys.Shift) }; yield return new EncloseSelectionInSomething(selectionText, "<strike>", "</strike>") { CommandText = "Strike out", CommandIcon = "/Thawmadoce;component/Media/format_text_strikethrough.png", KeyCombination = new KeyCombo(Key.OemMinus, ModifierKeys.Control | ModifierKeys.Shift) }; yield return new PrependLines(selectionText, "> ") { CommandText = "Quote", CommandIcon = "/Thawmadoce;component/Media/quote.png", KeyCombination = new KeyCombo(Key.Q, ModifierKeys.Control | ModifierKeys.Shift) }; yield return new PrependLines(selectionText, "1. ") { CommandText = "Numbered list", CommandIcon = "/Thawmadoce;component/Media/format_list_ordered.png", KeyCombination = new KeyCombo(Key.N, ModifierKeys.Control | ModifierKeys.Shift) }; yield return new PrependLines(selectionText, "* ") { CommandText = "Unnumbered list", CommandIcon = "/Thawmadoce;component/Media/format_list_unordered.png", KeyCombination = new KeyCombo(Key.M, ModifierKeys.Control | ModifierKeys.Shift) }; yield return new ToCode(selectionText) { CommandText = "Code", CommandIcon = "/Thawmadoce;component/Media/code-icon.png", KeyCombination = new KeyCombo(Key.C, ModifierKeys.Control | ModifierKeys.Shift) }; yield return new SelectionToLink(selectionText, _userInteraction) { CommandText = "Add Link", CommandIcon = "/Thawmadoce;component/Media/link.png", KeyCombination = new KeyCombo(Key.L, ModifierKeys.Control | ModifierKeys.Shift) }; }
public SelectionToLink(TextContext selectionText, IUserInteraction userInteraction) : base(selectionText) { _userInteraction = userInteraction; }
public ToCode(TextContext textContext) : base(textContext, " ") { }
private void StartWithThisText(string text, string selection = "") { _textCtx = new TextContext(selection, text); }
public EncloseSelectionInSomething(TextContext textContext, string prefixString, string postFixString) : base(textContext) { _prefixString = prefixString; _postFixString = postFixString; }
public EncloseSelectionInSomething(TextContext textContext, string enclosingString) : this(textContext, enclosingString, enclosingString) { }