static TextFormattingMenuItem FontFormatingMenuItem(TextFormatting textFormatting) =>
 new TextFormattingParentMenuItem(textFormatting, "Style", new List <TextFormattingMenuItem>()
 {
     new TextDecorationMenuItem(textFormatting, "Bold", "Bold"),
     new TextDecorationMenuItem(textFormatting, "Italic", "Italic"),
     new TextDecorationMenuItem(textFormatting, "Underline", "Underline"),
     new TextDecorationMenuItem(textFormatting, "Overline", "Overline"),
     new TextDecorationMenuItem(textFormatting, "Strikethrough", "Strikethrough")
 });
 public static List <TextFormattingMenuItem> MenuItems(TextFormatting textFormatting) =>
 new List <TextFormattingMenuItem>()
 {
     FontFamilyMenuItem(textFormatting),
     FontSizeMenuItem(textFormatting),
     new ClearFormattingMenuItem(textFormatting)
     {
         BeginGroup = false
     }
 };
 public static TextFormattingMenuItem FontSizeMenuItem(TextFormatting textFormatting) =>
 new FontFormattingParentMenuItem(textFormatting, "Size", new List <TextFormattingMenuItem>()
 {
     new FontSizeMenuItem(textFormatting, "8pt", 8),
     new FontSizeMenuItem(textFormatting, "10pt", 10),
     new FontSizeMenuItem(textFormatting, "12pt", 12),
     new FontSizeMenuItem(textFormatting, "14pt", 14),
     new FontSizeMenuItem(textFormatting, "18pt", 18),
     new FontSizeMenuItem(textFormatting, "24pt", 24),
     new FontSizeMenuItem(textFormatting, "36pt", 36)
 });
        public static TextFormattingMenuItem FontFamilyMenuItem(TextFormatting textFormatting, bool withDefualt = true)
        {
            var fontFamilies = new List <TextFormattingMenuItem>()
            {
                new FontFamilyMenuItem(textFormatting, "Times New Roman", "Times New Roman"),
                new FontFamilyMenuItem(textFormatting, "Tahoma", "Tahoma"),
                new FontFamilyMenuItem(textFormatting, "Verdana", "Verdana"),
                new FontFamilyMenuItem(textFormatting, "Arial", "Arial"),
                new FontFamilyMenuItem(textFormatting, "MS Sans Serif", "MS Sans Serif"),
                new FontFamilyMenuItem(textFormatting, "Courier", "Courier"),
                new FontFamilyMenuItem(textFormatting, "Segoe UI", "Segoe UI"),
            };

            if (withDefualt)
            {
                fontFamilies.Add(new FontFamilyMenuItem(textFormatting, "Default", null)
                {
                    BeginGroup = true
                });
            }
            return(new FontFormattingParentMenuItem(textFormatting, "Font", fontFamilies));
        }
Beispiel #5
0
 protected TextFormattingMenuItem(TextFormatting textFormatting, string text)
 {
     TextFormatting = textFormatting;
     Text           = text;
 }
Beispiel #6
0
 public override void Click()
 {
     TextFormatting.ClearFormatting();
 }
Beispiel #7
0
 public ClearFormattingMenuItem(TextFormatting textFormatting) : base(textFormatting, "Clear Formatting")
 {
 }
Beispiel #8
0
 public ChangeCaseMenuItem(TextFormatting textFormatting, string text, string textCase) : base(textFormatting, text)
 {
     TextCase = textCase;
 }
Beispiel #9
0
 public TextDecorationMenuItem(TextFormatting textFormatting, string text, string attributeName) : base(textFormatting, text)
 {
     AttributeName = attributeName;
 }
Beispiel #10
0
 public FontSizeMenuItem(TextFormatting textFormatting, string text, int fontSize) : base(textFormatting, text)
 {
     FontSize = fontSize;
 }
Beispiel #11
0
 public FontFamilyMenuItem(TextFormatting textFormatting, string text, string fontFamily) : base(textFormatting, text)
 {
     FontFamily = fontFamily;
 }
Beispiel #12
0
 public TextFormattingParentMenuItem(TextFormatting textFormatting, string text, List <TextFormattingMenuItem> children) : base(textFormatting, text)
 {
     Children = children;
 }
Beispiel #13
0
 public FontFormattingParentMenuItem(TextFormatting textFormatting, string text, List <TextFormattingMenuItem> children)
     : base(textFormatting, text, children)
 {
 }