private void fillCollector(NodeStateCollection nodes) { if (nodes.Equals(null)) { createCollectorObject(); return; } Dictionary <NodeId, NodeState> nodeDic = new Dictionary <NodeId, NodeState>(); foreach (NodeState node in nodes) { nodeDic.Add(node.NodeId, node); } NodeState Controller = nodeDic[new NodeId((int)Collector.ObjectsIDs.ObjectController, NamespaceIndex)]; //properties for addNamespace methodes Collector.ObjectsIDs[] methodsid = { Collector.ObjectsIDs.ObjectControlleraddNamespace, Collector.ObjectsIDs.ObjectControlleraddObjectNode, Collector.ObjectsIDs.ObjectControllergetObjectRootNode, Collector.ObjectsIDs.ObjectControllerauthenticate, Collector.ObjectsIDs.ObjectControllerregisterServer }; foreach (Collector.ObjectsIDs n in methodsid) { GenericMethodCalledEventHandler m; MethodState addNamespaceMethod = (MethodState)nodeDic[new NodeId((ushort)n, NamespaceIndex)]; NodeState input = nodeDic[new NodeId((ushort)(n + 1), NamespaceIndex)]; NodeState output = nodeDic[new NodeId((ushort)(n + 2), NamespaceIndex)]; switch (n) { case Collector.ObjectsIDs.ObjectControlleraddNamespace: m = method_addNamespace; break; case Collector.ObjectsIDs.ObjectControlleraddObjectNode: m = method_addObjectNode; break; case Collector.ObjectsIDs.ObjectControllergetObjectRootNode: m = method_getObjectRootNode; break; case Collector.ObjectsIDs.ObjectControllerauthenticate: m = method_authenticate; break; case Collector.ObjectsIDs.ObjectControllerregisterServer: m = method_registerServer; break; default: m = method_ControllerMethodStandard; break; } createMethod(Controller, addNamespaceMethod, (PropertyState)input, (PropertyState)output, m); } //machines Folder machines = (BaseObjectState)nodeDic[new NodeId((int)Collector.ObjectsIDs.FolderMachines, NamespaceIndex)]; }