createColor

createColor(color: Integer);

The createColor method of the JadeDotNetType class is a helper method that enables you to create a .NET Color object from the System.Drawing.dll assembly if that type has not been imported into JADE; for example, if an assembly contains a class in .NET called Basic and the class has a setColor method that requires a Color object as a parameter, a Basic class with a setColor method is created when the assembly is imported into JADE. However, the Color type is not imported because it is not specific to the assembly.

The parameter to the setColor method in JADE is of the generic JadeDotNetType type.

The following method shows the use of the createColor method.

vars
    b : Basic;                        // Subclass of JadeDotNetType
    c : JadeDotNetType;               // To represent a Color object
begin
    // Create a JADE instance of the class representing the .NET object
    create b transient;
    b.createDotNetObject;
    // Use the helper method to make a red Color object
    create c transient;
    c.createColor(Red);               // Red is a global JADE color constant
    // Use the color object as a parameter to the setColor method
    b.setColor(c);
epilog
    delete b;
    delete c;
end;