Exemple #1
0
        //private void contexteditorfontmenuitem_Click(object sender, RoutedEventArgs e)
        //{

        //    ChangeContextEditorFont();
        //}

        //private void contexteditorfontcolormenuitem_Click(object sender, RoutedEventArgs e)
        //{
        //    ChangeCoontextEditorFontColor();
        //}



        //private void contexteditoritalicmenuitem_Click(object sender, RoutedEventArgs e)
        //{
        //    TextBoxListViewToggleTag("i",true);
        //}

        //private void contexteditorundelinemenuitem_Click(object sender, RoutedEventArgs e)
        //{
        //    TextBoxListViewToggleTag("u",true);
        //}

        private void AddSpecialCharacterToCE()
        {
            StringBuilder stringbuilder = new StringBuilder("");
            Special_Charactors specialchars = new Special_Charactors(stringbuilder);
            if (specialchars.ShowDialog() == true)
            {
                int selectionstart = contextEditor.SelectionStart;
                contextEditor.Text = contextEditor.Text.Insert(selectionstart, specialchars.returncharactors.ToString());
            }
        }
Exemple #2
0
 private void SurroundMainListViewSelectedItemsWithSpecialCharacters(bool UndoAble)
 {
     if (mainListView.SelectedItems.Count < 1) return;
     StringBuilder grabber = new StringBuilder();
     Special_Charactors specialcharactors = new Special_Charactors(grabber);
     if (specialcharactors.ShowDialog() != true) return;
     string text = grabber.ToString();
     if (string.IsNullOrWhiteSpace(text)) return;
     using (UndoAble ? mainListView.SelectedItems.Count > 1 ? new ChangeCollection("{0} Lines Surrounded with {1} ", mainListView.SelectedItems.Count + "", text) : null:null)
     {
         if (mainListView.SelectedItems.Count > 1)
             foreach (Line item in mainListView.SelectedItems) item.SetContext(string.Format("{0}{1}{2}",text,item.Context,text),UndoAble);
         else
         {
             Line line = mainListView.SelectedItem as Line;
             line.SetContext(string.Format("{0}{1}{2}", text, line.Context, text), UndoAble, string.Format("Line Number {0} Text Decorate", line.LineNumber + ""));
         }
     }
 }