![]() |
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
|
|||||||
| Indicator Development Support for the development of custom indicators using NinjaScript. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Senior Member
Join Date: Jan 2005
Location: , ,
Posts: 218
Thanks: 0
Thanked 0 times in 0 posts
|
Please add the ability to serialize a SolidBrush.
Or better yet, can we flag individual member variables to not be serialized. In the code below, I don't need FTestBrush to be persisted (written to the disk). But I do need to be able to save the indicator in a workspace. The attribute [NonSerialized] holds the promise of dealing with these serialization errors but best I can tell, adding the attibute makes no difference conserning the serialization error. The following indicator generates a serialization error when you try to save it in a workspace: Code:
namespace NinjaTrader.Indicator
{
public class aaaTestSerialize : Indicator
{
[NonSerialized] //This does not seem to help.
public SolidBrush FTestBrush; //Fails Serialization
protected override void Initialize()
{}
protected override void OnBarUpdate()
{}
}
}
Last edited by shawnj; 12-04-2008 at 05:24 AM.
|
|
|
|
|
|
#2 |
|
NinjaTrader Product Manager
Join Date: May 2007
Location: Denver, CO
Posts: 17,458
Thanks: 1
Thanked 106 times in 70 posts
|
shawnj,
Thank you for the suggestion. If you do not mind could you please post future requests to the Suggestions and Feedback section in the forums? Thank you. I have forwarded this to development.
Josh
NinjaTrader Customer Service |
|
|
|
|
|
#3 |
|
Administrator
Join Date: Mar 2005
Location: Bamberg, Germany
Posts: 9,994
Thanks: 0
Thanked 6 times in 6 posts
|
To put this into right perspective: This is not a bug, but a limitation of the standard .NET XML serialization. Please consult MS docs for details. In the MS docs you e.g. would find how to properly use the [XmlIgnore()] attribute.
Dierk
NinjaTrader Customer Service |
|
|
|
|
|
#4 |
|
Senior Member
Join Date: Jan 2008
Location: Madrid, Spain
Posts: 229
Thanks: 2
Thanked 0 times in 0 posts
|
Thanks very much Dierk, with this attribute Font variables can be saved in a template, now.
|
|
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Serialization Error | shawnj | Indicator Development | 29 | 11-14-2011 06:11 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 |
| Bugs | Mike_32 | Miscellaneous Support | 4 | 07-24-2008 07:53 AM |
| Bugs? | MAX | Automated Trading | 5 | 01-02-2007 06:13 AM |