Specifications
Extensibility 3-19
3-19
variable with the widget.
Each DefaultView form must have a unique name. The object’s
default property view must be called DefaultView as it is the
property view HYSYS attempts to open when the object is
instantiated, provided the functionality of the OnView method is
not overridden.
Implement the Required Methods
To implement an extension in C# or VB.NET, you must first
create a Class Library project. In the project, you must then add
a reference to the HYSYS Interoperability Library
(Aspentech.HYSYS.Interop.dll) which can be found in the root
directory of the install location for Aspen HYSYS.
Next, you must create a class that implements the required
interfaces. For example, an Extension Unit Operation must
implement the ExtensionObject interface and the
ExtensionUnitOperation interface.
The class should have the appropriate attributes from the
System.Runtime.InteropServices namespace required to
export a class to COM. These include but are not limited to
ComVisible, ClassInterface, GuidAttribute, and
ProgIdAttribute. ComVisible must be set to true;
ClassInterface is recommend to be set to AutoDispatch which
is the default; GuidAttribute represents the CLSID and will be
generated if not specified (its highly recommended that you
specify this manually); ProgIdAttribute is optional unless you
refer to this class using the ProgID in the Extension Definition.
Register the Extension
You can register extensions on the Extensions tab of the Session
Preferences property view or using the regextn.exe command-
line executable.
A widget is an equivalent term for a control.
For more information on
extension registration
see Section 3.6 -
Registering
Extensions.