public void CreateGroupEnumerator(OPCENUMSCOPE dwScope, ref Guid riid, out object ppUnk) { OpcCom.Da.Wrapper.Server server; Monitor.Enter(server = this); try { switch (dwScope) { case OPCENUMSCOPE.OPC_ENUM_PUBLIC_CONNECTIONS: case OPCENUMSCOPE.OPC_ENUM_PUBLIC: if (riid != typeof(OpcRcw.Comn.IEnumString).GUID) { if (riid != typeof(IEnumUnknown).GUID) { throw new ExternalException("E_NOINTERFACE", -2147467262); } ppUnk = new EnumUnknown(null); } else { ppUnk = new OpcCom.Da.Wrapper.EnumString(null); } return; } if (riid == typeof(IEnumUnknown).GUID) { ppUnk = new EnumUnknown(this.m_groups); } else { if (riid != typeof(OpcRcw.Comn.IEnumString).GUID) { throw new ExternalException("E_NOINTERFACE", -2147467262); } ArrayList strings = new ArrayList(this.m_groups.Count); foreach (Group group in this.m_groups.Values) { strings.Add(group.Name); } ppUnk = new OpcCom.Da.Wrapper.EnumString(strings); } } catch (Exception exception) { throw CreateException(exception); } finally { Monitor.Exit(server); } }
public void CreateGroupEnumerator(OPCENUMSCOPE dwScope, ref Guid riid, out object ppUnk) { var methodName = nameof(IOPCServer) + "." + nameof(IOPCServer.CreateGroupEnumerator); try { var server = BeginComCall <IOPCServer>(methodName, true); server.CreateGroupEnumerator(dwScope, ref riid, out ppUnk); } finally { EndComCall(methodName); } }
public void CreateGroupEnumerator(OPCENUMSCOPE dwScope, ref Guid riid, out object ppUnk) { lock (this) { try { if (dwScope == OPCENUMSCOPE.OPC_ENUM_PUBLIC_CONNECTIONS || dwScope == OPCENUMSCOPE.OPC_ENUM_PUBLIC) { if (riid == typeof(IEnumString).GUID) { ppUnk = new EnumString(null); return; } if (riid == typeof(IEnumUnknown).GUID) { ppUnk = new EnumUnknown(null); return; } throw new ExternalException("E_NOINTERFACE", -2147467262); } if (riid == typeof(IEnumUnknown).GUID) { ppUnk = new EnumUnknown(m_groups); return; } if (riid == typeof(IEnumString).GUID) { ArrayList arrayList = new ArrayList(m_groups.Count); foreach (Group value in m_groups.Values) { arrayList.Add(value.Name); } ppUnk = new EnumString(arrayList); return; } throw new ExternalException("E_NOINTERFACE", -2147467262); } catch (Exception e) { throw CreateException(e); } } }
public void CreateGroupEnumerator(OPCENUMSCOPE dwScope, ref Guid riid, out object ppUnk) { var methodName = nameof(IOPCServer) + "." + nameof(IOPCServer.CreateGroupEnumerator); try { var server = BeginComCall<IOPCServer>(methodName, true); server.CreateGroupEnumerator(dwScope, ref riid, out ppUnk); } finally { EndComCall(methodName); } }