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:
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() {} } }
Comment