本文整理匯總了C#中Opc.Ua.MethodState.AddReference方法的典型用法代碼示例。如果您正苦於以下問題:C# MethodState.AddReference方法的具體用法?C# MethodState.AddReference怎麽用?C# MethodState.AddReference使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Opc.Ua.MethodState
的用法示例。
在下文中一共展示了MethodState.AddReference方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: CreateAddressSpace
public override void CreateAddressSpace(IDictionary<NodeId, IList<IReference>> externalReferences)
{
base.CreateAddressSpace(externalReferences);
// hard code a sample branch that has the method added.
NodeId branchId = DaModelUtils.ConstructIdForDaElement("Static/Simple Types", -1, NamespaceIndex);
// create the method.
MethodState method = new MethodState(null);
method.NodeId = GenerateNodeId();
method.BrowseName = new QualifiedName("GenerateRandomValues", NamespaceIndex);
method.DisplayName = method.BrowseName.Name;
method.Executable = true;
method.UserExecutable = true;
method.ReferenceTypeId = ReferenceTypeIds.HasComponent;
method.Handle = "Static/Simple Types";
method.AddReference(ReferenceTypeIds.HasComponent, true, branchId);
m_references[branchId] = new IReference[] { new NodeStateReference(ReferenceTypeIds.HasComponent, false, method) };
// save the node for later lookup (all tightly coupled children are added with this call).
AddPredefinedNode(SystemContext, method);
// register handler.
method.OnCallMethod = new GenericMethodCalledEventHandler(DoGenerateRandomValues);
}