Harness proD API Help
EPLAN.Harness.API.ApiProperties Namespace / ColorProperty Class
Members Example
In This Topic
    ColorProperty Class
    In This Topic
    Property which stores System.Drawing.Color values.
    Object Model
    ColorProperty ClassPropertyValue Class
    Inheritance Hierarchy

    System.Object
       EPLAN.Harness.API.ApiProperties.Property
          EPLAN.Harness.API.ApiProperties.ColorProperty

    Syntax
    public class ColorProperty : Property 
    Remarks

    Represents a property with a color value.

    Example
    The following example shows how to use the class ColorProperty.
    ColorProperty color = new ColorProperty(Color.Gold);
    ColorProperty hexColor = new ColorProperty("#00ff00");
    ColorProperty argbFloatColor = new ColorProperty(0.4f, 1f, 0.4f, 1f);
    ColorProperty rgbColor = new ColorProperty(255, 102, 0);
    ColorProperty knownColor = new ColorProperty(KnownColor.Red);
    ColorProperty argbColor = new ColorProperty(100, 210, 210, 210);
    ColorProperty nameColor = new ColorProperty("blue");
    
    Console.WriteLine(color);
    Console.WriteLine(hexColor.ToString());
    Console.WriteLine((Color) argbFloatColor.Value);
    Console.WriteLine(rgbColor.Value.ToString());
    Console.WriteLine(knownColor.Value == Color.FromKnownColor(KnownColor.Red));
    Console.WriteLine(argbColor.Value == Color.FromArgb(100, 210, 210, 210));
    Console.WriteLine(nameColor.Value == Color.FromName("blue"));
    
    // Results:
    // Color [Gold]
    // Color [A=255, R=0, G=255, B=0]
    // Color [A=102, R=255, G=102, B=255]
    // Color [A=255, R=255, G=102, B=0]
    // True
    // True
    // True
    
    color = Color.Blue;
    knownColor = KnownColor.Yellow;
    hexColor = "#ff0000";
    nameColor = "black";
    
    Console.WriteLine(color);
    Console.WriteLine(knownColor);
    Console.WriteLine(hexColor);
    Console.WriteLine(nameColor);
    
    // Results:
    // Color [Blue]
    // Color [Yellow]
    // Color [A=255, R=255, G=0, B=0]
    // Color [Black]
    Public Constructors
     NameDescription
    Public ConstructorOverloaded.   
    Top
    Public Properties
     NameDescription
    Public Property Specifies whether the property is interval. (Inherited from EPLAN.Harness.API.ApiProperties.Property)
    Public Property Unit of the value of this property. (Inherited from EPLAN.Harness.API.ApiProperties.Property)
    Public Property Gets the value of this property. (Inherited from EPLAN.Harness.API.ApiProperties.Property)
    Top
    Public Methods
     NameDescription
    Public MethodIs this property equal to the following object?  
    Public MethodServes as the default hash function.  
    Public MethodReturns a string that represents the current object. (Inherited from EPLAN.Harness.API.ApiProperties.Property)
    Top
    Public Operators
    Are these properties equal?
    Overloaded. Implicit conversion from System.Drawing.Color to ColorProperty.
    Are these properties not equal?
    Top
    See Also