• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

NinjaTrader.Core.CoreEnumConverter not found

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

  • NinjaTrader_Jesse
    replied
    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.

    Leave a comment:


  • cls71
    replied
    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:


  • NinjaTrader_Jesse
    replied
    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?
    http://ninjatrader.com/support/helpG...definedbrushes

    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:


  • cls71
    replied
    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);
                    }
                }
    (If instead Stroke class you use Brush or SimpleFont classes, the code works fine).

    Leave a comment:


  • cls71
    started a topic NinjaTrader.Core.CoreEnumConverter not found

    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 488

Latest Posts

Collapse

Topics Statistics Last Post
Started by peterslane1, Today, 09:47 AM
0 responses
3 views
0 likes
Last Post peterslane1  
Started by mtamaku, Today, 09:34 AM
0 responses
6 views
0 likes
Last Post mtamaku
by mtamaku
 
Started by datahogg, Today, 08:48 AM
1 response
7 views
0 likes
Last Post NinjaTrader_Kate  
Started by Newtrader101, 11-02-2019, 06:36 PM
4 responses
405 views
1 like
Last Post datahogg  
Started by eostradingsystems, Today, 08:11 AM
1 response
15 views
0 likes
Last Post MojoJojo  
Working...
X