Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Colors disappear when restarting Ninja

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

    Colors disappear when restarting Ninja

    Hi,

    When I apply my custom indicator to a chart it all works fine. The input colors are setup correctly, as shown in attachment 1. But if I save the workspace, close Ninja, restart Ninja, and then reopen the workspace, the colors have all disappeared, as shown in attachment 2.

    The colors are defined as variables in the Variables section

    Code:
     
    #region Variables
    private System.Drawing.Color color1 = Color.White;
    private System.Drawing.Color color2 = Color.ForestGreen;
    private System.Drawing.Color color3 = Color.Lime;
    private System.Drawing.Color color4 = Color.LightSkyBlue;
    private System.Drawing.Color color5 = Color.Yellow;
    private System.Drawing.Color color6 = Color.DarkOrange;
    private System.Drawing.Color color7 = Color.Red;
    private System.Drawing.Color color8 = Color.White;
    and as inputs in the Properties section

    Code:
     
    #region Properties
     
    [Description("Color 1")]
    [GridCategory("Parameters")]
    public Color Color1
    {
    get { return color1; }
    set { color1 = value; }
    }
     
    [Description("Color 2")]
    [GridCategory("Parameters")]
    public Color Color2
    {
    get { return color2; }
    set { color2 = value; }
    }
     
    ...


    This is Ninja 7 beta 18. Is this a known bug or am I doing something wrong?

    Thanks
    Attached Files
    Last edited by bubblegum; 07-08-2010, 04:54 AM.

    #2
    bubblegum, you would need to serialize the color properties in your code properly, then those could be saved in the workspaces and thus persisted on restart -

    Comment


      #3
      Thank you very much for your quick reply. It worked.

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by Hwop38, 05-04-2026, 07:02 PM
      0 responses
      160 views
      0 likes
      Last Post Hwop38
      by Hwop38
       
      Started by CaptainJack, 04-24-2026, 11:07 PM
      0 responses
      308 views
      0 likes
      Last Post CaptainJack  
      Started by Mindset, 04-21-2026, 06:46 AM
      0 responses
      245 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Started by M4ndoo, 04-20-2026, 05:21 PM
      0 responses
      349 views
      0 likes
      Last Post M4ndoo
      by M4ndoo
       
      Started by M4ndoo, 04-19-2026, 05:54 PM
      0 responses
      178 views
      0 likes
      Last Post M4ndoo
      by M4ndoo
       
      Working...
      X