Click or drag to resize

SystemUnitFamilyTypeAddRoleClassReference(RoleFamilyType, Boolean) Method

Adds a RoleClass reference to this SystemUnitClass object using the provided RoleClass object. The RoleClass reference is added as a SupportedRoleClassType object.

Namespace: Aml.Engine.CAEX
Assembly: Aml.Engine (in Aml.Engine.dll) Version: 3.2
Syntax
public IObjectWithRoleReference AddRoleClassReference(
	RoleFamilyType roleClass,
	bool addUnique = true
)

Parameters

roleClass  RoleFamilyType
The RoleClass to be assigned to the SystemUnitClass.
addUnique  Boolean  (Optional)
if set to true, the RoleClass reference is not added, if a reference to the provided RoleClass already exists.

Return Value

IObjectWithRoleReference
The new added RoleClass reference.
Exceptions
ExceptionCondition
ArgumentNullExceptionroleClass
Example
This sample shows how to call the AddRoleClassReference(RoleFamilyType, Boolean) method using a standard base RoleClass from the RoleClassLib(CAEXDocument)
C#
var amlBaseRoleClassLib = AutomationMLBaseRoleClassLibType.RoleClassLib (myDocument);
var mySlib = myDocument.CAEXFile.SystemUnitClassLib.Append ("mySlib");
var mySuc = mySlib.SystemUnitClass.Append("mySuc");
mySuc.AddRoleClassReference (amlBaseRoleClassLib.AutomationMLBaseRole);
See Also