Announcement
Collapse
Looking for a User App or Add-On built by the NinjaTrader community?
Visit NinjaTrader EcoSystem and our free User App Share!
Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less
Partner 728x90
Collapse
NinjaTrader
NinjaTrader.Core.CoreEnumConverter not found
Collapse
X
-
Hello,
Thank you for the clarification and sample.
I will review this, once I have further details on this I will reply back here.
I look forward to being of further assistance.
-
Sorry, maybe I should not have used the word "serialization".
If you use XamlWriter with a Brush, the process is ok.However, if you use a Stroke, then an exception is rised.
I am not using properties. Standard objects only.
Attach an indicator to test it.Attached Files
Leave a comment:
-
Hello,
Thank you for the post.
I wanted to check, are you currently ignoring the non-serializable types such as Brush and Stroke and making string properties for these to serialize within your objects properties?
If not, I would suggest trying to comment out all of the properties and make a simple string property, then check that the serialize method works as expected. You could then use this process and uncomment one property at a time to locate what is throwing the error specifically.
If you have a sample set up you could provide to the forum I could also try running that sample to see what I can locate.
I look forward to being of further assistance.
Leave a comment:
-
It definitely looks like the bug is in the NinjaTrader.Gui.Stroke class.
This code rises the exception:
Code:Microsoft.Win32.SaveFileDialog dlg = new Microsoft.Win32.SaveFileDialog(); Nullable<Boolean> result = dlg.ShowDialog(); if (result.Value) { try { using (Stream stream = File.Create(dlg.FileName)) { Object o = new Stroke(Brushes.Red); XamlWriter.Save( o, stream ); } } catch (Exception ex) { NinjaTrader.Code.Output.Process(ex.Message + Environment.NewLine + ex.StackTrace, PrintTo.OutputTab1); } }
Leave a comment:
-
NinjaTrader.Core.CoreEnumConverter not found
Hello,
I am getting this exception when I try to serialize an object. The object has properties of type Brush, Stroke and SimpleFont.
I use the XamlWrite.Save( myobject ) method to save the object.
I am not using any EnumConverter in my class.
The Stroke class has one enum named NinjaTrader.Gui.DashStyleHelper. Maybe the bug is there.
Thanks.
handlerDialogSettings_btnSave_Click Now=11:22:36
Constructor on type 'NinjaTrader.Core.CoreEnumConverter' not found.
at System.RuntimeType.CreateInstanceImpl(BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes, StackCrawlMark& stackMark)
at System.Activator.CreateInstance(Type type, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes)
at System.Activator.CreateInstance(Type type, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture)
at System.Xaml.TypeConverterHelper.GetTypeConverter(T ype type)
at System.Windows.Markup.ValueSerializer.GetSerialize rFor(Type type)
at System.Windows.Markup.ValueSerializer.GetSerialize rFor(PropertyDescriptor descriptor)
at System.Windows.Markup.Primitives.ElementPropertyBa se.GetValueSerializer()
at System.Windows.Markup.Primitives.ElementPropertyBa se.CanConvertToString(Object value)
at System.Windows.Markup.Primitives.ElementProperty.g et_Value()
at System.Windows.Markup.Primitives.ElementPropertyBa se.get_IsComposite()
at System.Windows.Markup.Primitives.MarkupWriter.Reco rdNamespaces(Scope scope, MarkupObject item, IValueSerializerContext context, Boolean lastWasString)
at System.Windows.Markup.Primitives.MarkupWriter.Reco rdNamespaces(Scope scope, MarkupObject item, IValueSerializerContext context, Boolean lastWasString)
at System.Windows.Markup.Primitives.MarkupWriter.Reco rdNamespaces(Scope scope, MarkupObject item, IValueSerializerContext context, Boolean lastWasString)
at System.Windows.Markup.Primitives.MarkupWriter.Writ eItem(MarkupObject item)
at System.Windows.Markup.Primitives.MarkupWriter.Save AsXml(XmlWriter writer, MarkupObject item)
at System.Windows.Markup.XamlWriter.Save(Object obj)
at NinjaTrader.NinjaScript.AddOns.SupperiaOutputWindo w.handlerDialogSettings_btnSave_Click(Object sender, RoutedEventArgs e) in c:\Users\ROMAN\Documents\NinjaTrader 8\bin\Custom\AddOns\SupperiaOutput.cs:line 488Tags: None
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by Noerclou, Today, 04:55 AM
|
0 responses
1 view
0 likes
|
Last Post
by Noerclou
Today, 04:55 AM
|
||
Started by llanqui, Yesterday, 09:59 AM
|
2 responses
16 views
0 likes
|
Last Post
by llanqui
Today, 04:00 AM
|
||
Started by ThoriSten, Today, 03:56 AM
|
0 responses
6 views
0 likes
|
Last Post
by ThoriSten
Today, 03:56 AM
|
||
Started by PhillT, 04-19-2024, 02:16 PM
|
3 responses
20 views
0 likes
|
Last Post
by mangel2000
Today, 03:04 AM
|
||
Started by TraderBCL, Today, 02:37 AM
|
0 responses
4 views
0 likes
|
Last Post
by TraderBCL
Today, 02:37 AM
|
Leave a comment: