public Enumerator(HashtableProxy proxy) { if (proxy == null) { throw new ArgumentNullException(nameof(proxy)); } _items = proxy.GetKeyValuePair(); }
private int GetCurrentConnections() { if (Context.IsCoreRuntime) { return(0); } var connectionGroupListObject = TargetObject.ReadObjectField("m_ConnectionGroupList"); var connectionGroupListProxy = new HashtableProxy(Context, connectionGroupListObject); var connectionGroupListKeyValuePair = connectionGroupListProxy.GetKeyValuePair(); int result = 0; foreach (var connectionGroupItem in connectionGroupListKeyValuePair) { var connectionListObject = connectionGroupItem.Value.ReadObjectField("m_ConnectionList"); var connectionListProxy = new ArrayListProxy(Context, connectionListObject); result += connectionListProxy.Count; } return(result); }
public IEnumerable <ConnectionProxy> GetConnections() { if (Context.IsCoreRuntime) { throw new CoreRuntimeNotSupportedException(); } // TODO join logic with GetCurrentConnections var connectionGroupListObject = TargetObject.ReadObjectField("m_ConnectionGroupList"); var connectionGroupListProxy = new HashtableProxy(Context, connectionGroupListObject); var connectionGroupListKeyValuePair = connectionGroupListProxy.GetKeyValuePair(); foreach (var connectionGroupItem in connectionGroupListKeyValuePair) { var connectionListProxy = new ArrayListProxy(Context, connectionGroupItem.Value.ReadObjectField("m_ConnectionList")); foreach (var connectionObject in connectionListProxy.GetItems()) { yield return(new ConnectionProxy(Context, connectionObject)); } } }