NinjaTrader Support Forum  
X

Attention!

This website will be down for maintenance from Friday May 24th at 6PM MDT until Saturday May 25th at 11AM MDT. We apologize for the inconvenience. If you need assistance during this time, please email sales@ninjatrader.com


Go Back   NinjaTrader Support Forum > Application Technical Support > Miscellaneous Support

Miscellaneous Support Miscellaneous support issues.

Reply
 
Thread Tools Display Modes
Old 05-21-2009, 09:34 PM   #1
funk101
Senior Member
 
Join Date: Jan 2006
Location: Margate, Florida, USA
Posts: 426
Thanks: 0
Thanked 2 times in 2 posts
Send a message via AIM to funk101
Default 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 at 09:55 PM.
funk101 is offline  
Reply With Quote
Old 05-22-2009, 08:27 AM   #2
NinjaTrader_Dierk
Administrator
 
NinjaTrader_Dierk's Avatar
 
Join Date: Mar 2005
Location: Bamberg, Germany
Posts: 9,994
Thanks: 0
Thanked 6 times in 6 posts
Default

"bool" is a basic type like "int", "double" etc. -> no need to apply any custom handling for XML serialization
NinjaTrader_Dierk is offline  
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Serialization Error shawnj Indicator Development 29 11-14-2011 06:11 AM
Serialization Error gyoung Miscellaneous Support 14 05-03-2009 04:33 AM
More Serialization Bugs - SolidBrush shawnj Indicator Development 3 12-04-2008 09:06 AM
Serialization Bug shawnj Indicator Development 2 12-03-2008 12:28 AM
Serialization error ct Strategy Development 1 09-12-2008 02:32 PM


All times are GMT -6. The time now is 04:42 AM.