Exemple #1
0
    public override void gaxb_final(TB.TBXMLElement element, object _parent, Hashtable args)
    {
        base.gaxb_final(element, _parent, args);

        if (element != null)
        {
            style = element.GetAttribute("style");

            string s = element.GetAttribute("value");
            if (s != null)
            {
                value = PlanetUnityStyle.ReplaceStyleTags(PlanetUnityOverride.processString(this, s));
            }

            s = element.GetAttribute("autoreload");
            if (s != null)
            {
                autoreload = bool.Parse(s);
            }
        }

        if (style != null)
        {
            string classString = "MarkdownStyle" + style;

            Type entityClass = Type.GetType(classString, true);
            mdStyle = (Activator.CreateInstance(entityClass)) as MarkdownStyle;
        }
        else
        {
            mdStyle = new MarkdownStyleGeneric();
        }

        mdStyle.markdownEntity = this;
    }
 List <SettingsItemViewModel> GetMarkdownStyleSettings(MarkdownStyle style, bool showBorderSize = true)
 {
     return(new List <SettingsItemViewModel>
     {
         new StepperSettingsItemViewModel(this, "Font size", (int)style.FontSize)
         {
             Action = (int value) => style.FontSize = value,
         },
         new StepperSettingsItemViewModel(this, "Line height", (int)style.LineHeight)
         {
             Action = (int value) => style.LineHeight = value,
         },
         new PickerSettingsViewModel(this, "Font attributes", fontAttributeItems, style.Attributes)
         {
             Action = (object value) => style.Attributes = (FontAttributes)value,
         },
         new PickerSettingsViewModel(this, "Text decorations", textDecorationItems, style.TextDecorations)
         {
             Action = (object value) => style.TextDecorations = (TextDecorations)value,
         },
         new PickerSettingsViewModel(this, "Horizontal text alignment", textAlignmentItems, style.HorizontalTextAlignment)
         {
             Action = (object value) => style.HorizontalTextAlignment = (TextAlignment)value,
         },
         new PickerSettingsViewModel(this, "Vertical text alignment", textAlignmentItems, style.VerticalTextAlignment)
         {
             Action = (object value) => style.VerticalTextAlignment = (TextAlignment)value,
         },
         new StepperSettingsItemViewModel(this, "Border size", (int)style.BorderSize)
         {
             Action = (int value) => style.BorderSize = value,
             IsVisible = showBorderSize,
         },
     });
 }
    public override void gaxb_final(TB.TBXMLElement element, object _parent, Hashtable args)
    {
        base.gaxb_final(element, _parent, args);

        if (element != null) {
            style = element.GetAttribute ("style");

            string s = element.GetAttribute ("value");
            if (s != null) {
                value = PlanetUnityStyle.ReplaceStyleTags(PlanetUnityOverride.processString(this, s));
            }

            s = element.GetAttribute ("autoreload");
            if (s != null) {
                autoreload = bool.Parse(s);
            }
        }

        if (style != null) {
            string classString = "MarkdownStyle" + style;

            Type entityClass = Type.GetType (classString, true);
            mdStyle = (Activator.CreateInstance (entityClass)) as MarkdownStyle;
        } else {
            mdStyle = new MarkdownStyleGeneric();
        }

        mdStyle.markdownEntity = this;
    }
 void CopyMarkdownStyle(MarkdownStyle source, MarkdownStyle target)
 {
     target.Attributes = source.Attributes;
     target.FontSize   = source.FontSize;
     target.LineHeight = source.LineHeight;
     target.HorizontalTextAlignment = source.HorizontalTextAlignment;
     target.VerticalTextAlignment   = source.VerticalTextAlignment;
     target.BorderSize      = source.BorderSize;
     target.TextDecorations = source.TextDecorations;
 }