Esempio n. 1
0
        protected PlantUmlText AddStyle(PlantUmlText text)
        {
            if (SymbolColor != null)
            {
                text = text.WithFontColor(SymbolColor.Value);
            }

            if (FontSize != null)
            {
                text = text.WithFontSize(FontSize.Value);
            }

            var h = AddStyleToSymbol;

            if (h is null)
            {
                return(text.WithFontSize(14));
            }
            var q = new AddStyleToSymbolEventArgs
            {
                Text = text
            };

            h.Invoke(this, q);
            return(q.Text);
        }
Esempio n. 2
0
 public static PlantUmlText WithWrap(this PlantUmlText src, string prefixAndSuffix)
 {
     if (src is null || src.IsEmpty)
     {
         return(src);
     }
     return(prefixAndSuffix + src.Text + prefixAndSuffix);
 }
Esempio n. 3
0
 public static PlantUmlText WithFontColor(this PlantUmlText src, UmlColor color)
 {
     if (color.IsEmpty)
     {
         return(src);
     }
     return(src.WithWrapHtml("color", color.PlantUmlCode));
 }
Esempio n. 4
0
        public static PlantUmlText WithWrapHtml(this PlantUmlText src, string tag, string arg = null)
        {
            if (src is null || src.IsEmpty)
            {
                return(src);
            }
            var opening = string.IsNullOrEmpty(arg) ? tag : $"{tag}:{arg}";

            return($"<{opening}>{src.Text}</{tag}>");
        }
Esempio n. 5
0
 public static PlantUmlText WithUnderline(this PlantUmlText src, string color = null)
 {
     if (src is null || src.IsEmpty)
     {
         return(src);
     }
     if (string.IsNullOrEmpty(color))
     {
         return(src.WithWrap("__"));
     }
     return(src.WithWrapHtml("u", color));
 }
Esempio n. 6
0
 public static PlantUmlText WithTextInNewLine(this PlantUmlText src, string x)
 {
     if (string.IsNullOrEmpty(x))
     {
         return(src);
     }
     if (src is null || src.IsEmpty)
     {
         return(x);
     }
     return($"{src.Text}\n{x}");
 }
Esempio n. 7
0
 public SymbolInfo(string symbolName, PlantUmlText symbolText, PlantUmlText description)
 {
     if (symbolText is null || symbolText.IsEmpty)
     {
         throw new ArgumentException(nameof(symbolText));
     }
     if (description is null || description.IsEmpty)
     {
         throw new ArgumentException(nameof(description));
     }
     SymbolName  = symbolName;
     SymbolText  = symbolText;
     Description = description;
 }
Esempio n. 8
0
 public void AddSymbol(PlantUmlText symbol)
 {
     Symbols.Add(symbol);
 }
Esempio n. 9
0
 public static PlantUmlText WithBold(this PlantUmlText src)
 {
     return(src.WithWrap("**"));
 }
Esempio n. 10
0
 public static PlantUmlText WithWaved(this PlantUmlText src)
 {
     return(src.WithWrap("~~"));
 }
Esempio n. 11
0
 public static PlantUmlText WithStroked(this PlantUmlText src)
 {
     return(src.WithWrap("--"));
 }
Esempio n. 12
0
 public static PlantUmlText WithBackground(this PlantUmlText src, string color)
 {
     return(src.WithWrapHtml("back", color));
 }
Esempio n. 13
0
 public static PlantUmlText WithMonospaced(this PlantUmlText src)
 {
     return(src.WithWrap("\"\""));
 }
Esempio n. 14
0
 public static PlantUmlText WithItalic(this PlantUmlText src)
 {
     return(src.WithWrap("//"));
 }
Esempio n. 15
0
 public static PlantUmlText WithFontSize(this PlantUmlText src, int size)
 {
     return(src.WithWrapHtml("size", size.ToInv()));
 }