.NET Helper Methods

When you import a .NET assembly, JADE generates classes for each class that is selected. However, an assembly can also reference other assemblies (or use types defined in other assemblies). For example, a control assembly (say myControls.dll) could refer to .NET Color, Font, and Image objects that are defined in the System.Drawing.dll assembly. If these types have not been imported, JADE creates instances of the JadeDotNetType class to represent them.

To enable the use of Color, Font, and Image .NET objects without having to import the System.Drawing.dll assembly, the helper methods listed in the following table are provided to access properties of Color, Font, and Image objects from a JadeDotNetType instance.

JadeDotNetType Helper Method Returns …
getColor A 32-bit number, representing the ARGB color value
getFont The font properties of the Font object
getPicture A binary, representing the image

An exception is raised if these methods are called on objects that do not represent the appropriate type (for example, the getColor can only be used on a .NET Color object).

The helper methods listed in the following table are provided as an alternative to the createDotNetObject method to create Color, Font, and Image objects from a JadeDotNetType instance.

JadeDotNetType Helper Method Creates a .NET …
createColor Color object using the supplied ARGB color value
createFont Font object from the supplied font properties
createPicture Image object from the supplied binary value

An exception is raised if the .NET object cannot be created for any reason.