 | SystemUnitClassTypeAddInterfaceClassReference(InterfaceFamilyType, Boolean, Boolean, String) Method |
Adds an InterfaceClass reference to this SystemUnitClass object using the provided
InterfaceClass object. The InterfaceClass reference is added as
a
ExternalInterfaceType object.
Namespace: Aml.Engine.CAEXAssembly: Aml.Engine (in Aml.Engine.dll) Version: 3.2
Syntaxpublic ExternalInterfaceType AddInterfaceClassReference(
InterfaceFamilyType interfaceClass,
bool addUnique = true,
bool addInstance = false,
string name = ""
)
Public Function AddInterfaceClassReference (
interfaceClass As InterfaceFamilyType,
Optional addUnique As Boolean = true,
Optional addInstance As Boolean = false,
Optional name As String = ""
) As ExternalInterfaceType
public:
ExternalInterfaceType^ AddInterfaceClassReference(
InterfaceFamilyType^ interfaceClass,
bool addUnique = true,
bool addInstance = false,
String^ name = L""
)
Parameters
- interfaceClass InterfaceFamilyType
- The InterfaceClass to be assigned to the SystemUnitClass.
- addUnique Boolean (Optional)
-
if set to true, the InterfaceClass reference is not added, if a reference to the
provided InterfaceClass already exists.
- addInstance Boolean (Optional)
-
if set to true, the reference is created as am instance of the InterfaceClass,
containing all ExternalInterfaces and Attributes of the InterfaceClass.
- name String (Optional)
- Provides the name for the new external interface.
Return Value
ExternalInterfaceType
The new added InterfaceClass reference.
Exceptions
Remarks
The default behaviour is, that only a reference to the interface class is added and no instance of
the class containing all Attributes and ExternalInterface objects. If an instance is required,
set the optional parameter 'addInstance' to true or
use the
CreateClassInstance
and the
Insert(CAEXWrapper, Boolean) methods.
Example
This sample shows how to call the
AddInterfaceClassReference(InterfaceFamilyType, Boolean, Boolean, String)
method using
a standard base InterfaceClass from the
InterfaceClassLib(CAEXDocument)var amlInterfaceClassLib = AutomationMLInterfaceClassLibType.InterfaceClassLib (myDocument);
var myIH = myDocument.CAEXFile.InstanceHierarchy.Append ("myIH");
var myIE = myIH.InternalElement.Append("myIH");
myIE.AddInterfaceClassReference (amlInterfaceClassLib.AutomationMLBaseInterface);
See Also