Exemplo n.º 1
0
 public Enumerator(HashtableProxy proxy)
 {
     if (proxy == null)
     {
         throw new ArgumentNullException(nameof(proxy));
     }
     _items = proxy.GetKeyValuePair();
 }
Exemplo n.º 2
0
        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);
        }
Exemplo n.º 3
0
        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));
                }
            }
        }