Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Serialization...

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Serialization...

    On all my properties, where the user has access to change them, like colors, etc. I've serialized like so:
    /// <summary>
    /// DefaultTextColor
    /// </summary>
    /// <returns>Color</returns>
    [XmlIgnore]
    [Description("Set the default text color. Default: Black")]
    [Category("Design Layer")]
    [NinjaTrader.Gui.Design.DisplayName("Default Text Color")]
    public Color DefaultTextColor
    {
    get { return defaultTextColor; }
    set { defaultTextColor = value; }
    }
    [Browsable(false)]
    public string DefaultTextColorSerialize
    {
    get { return NinjaTrader.Gui.Design.SerializableColor.ToString( defaultTextColor); }
    set { defaultTextColor = NinjaTrader.Gui.Design.SerializableColor.FromStrin g(value); }
    }

    ...I've done this with Fonts as well, however, when it comes to Booleans, I can't figure out the correct syntax, as intellisense doesn't really "hint" anything. I was looking for something like:

    NinjaTrader.Gui.Design.SerializableBoolean.ToStrin g(blah)...

    how does one serialize a boolean? and for that matter, Pens, etc
    Last edited by funk101; 05-21-2009, 09:55 PM.

    #2
    "bool" is a basic type like "int", "double" etc. -> no need to apply any custom handling for XML serialization

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by argusthome, 03-08-2026, 10:06 AM
    0 responses
    72 views
    0 likes
    Last Post argusthome  
    Started by NabilKhattabi, 03-06-2026, 11:18 AM
    0 responses
    43 views
    0 likes
    Last Post NabilKhattabi  
    Started by Deep42, 03-06-2026, 12:28 AM
    0 responses
    25 views
    0 likes
    Last Post Deep42
    by Deep42
     
    Started by TheRealMorford, 03-05-2026, 06:15 PM
    0 responses
    28 views
    0 likes
    Last Post TheRealMorford  
    Started by Mindset, 02-28-2026, 06:16 AM
    0 responses
    58 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Working...
    X