コード例 #1
0
ファイル: PrependLines.cs プロジェクト: flq/Thawmadoce
 public PrependLines(TextContext textContext, string prefix)
     : base(textContext)
 {
     _prefix = prefix;
 }
コード例 #2
0
ファイル: SelectionCommand.cs プロジェクト: flq/Thawmadoce
 protected SelectionCommand(TextContext textContext)
 {
     TextContext = textContext;
 }
コード例 #3
0
 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;
 }
コード例 #4
0
        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)
            };
        }
コード例 #5
0
ファイル: SelectionToLink.cs プロジェクト: flq/Thawmadoce
 public SelectionToLink(TextContext selectionText, IUserInteraction userInteraction)
     : base(selectionText)
 {
     _userInteraction = userInteraction;
 }
コード例 #6
0
ファイル: ToCode.cs プロジェクト: flq/Thawmadoce
 public ToCode(TextContext textContext)
     : base(textContext, "    ")
 {
 }
コード例 #7
0
 private void StartWithThisText(string text, string selection = "")
 {
     _textCtx = new TextContext(selection, text);
 }
コード例 #8
0
 public EncloseSelectionInSomething(TextContext textContext, string prefixString, string postFixString)
     : base(textContext)
 {
     _prefixString = prefixString;
     _postFixString = postFixString;
 }
コード例 #9
0
 public EncloseSelectionInSomething(TextContext textContext, string enclosingString)
     : this(textContext, enclosingString, enclosingString)
 {
 }