Start a new topic
Implemented

IswAttributeType.GetColor(...)

I was retrieving the colors for an Enum attribute and noticed that if one(or more) of the colors are pure white, GetColor(...) will throw a NullReferenceException. This feels very odd since there is no way of preventing it besides not using white for any Enum value.


I would like you to either:

  1. Return white when the color is white.
  2. Overload the HasColor method so that you can set a default color yourself (without a try-catch).

What I want to be able to do is basically:

  

IswAttributeType verdictType = SWConnection.Instance.Broker.AttributeType("EnumSID");
Dictionary<string, Color> colors = new Dictionary<string, Color>();
foreach(string str in verdictType.RangeArray)
{
    colors.Add(str, verdictType.GetColor(str));
}

 A build in method to retrieve such a Dictionary would also suffice.


Should probably mention that I meant overload HasColor to accept a string. This way you could call it for each individual value in the RangeArray.

Hi Alexander.

That it throws an exception is a bug and we will get this fixed ASAP, that is: return white when the color is white.

1 person likes this

Hi Alexander, 


This has been fixed and will be available with our R25 release which is expected to be available at the end of this week. 


Systemite Support

Release R25 is now available! R25 (20997) Release Notes Summary - March 2, 2018


Best regards, 

Systemite Support

Login to post a comment