Exemplo n.º 1
0
        public System.Collections.Generic.List <PropertiesMessage> GetProperties_ALL()
        {
            System.DateTime createTime = System.DateTime.Now;
            SystemThreadPool <SnmpConfiger, PropertiesMessage> systemThreadPool = new SystemLargeThreadPool <SnmpConfiger, PropertiesMessage>(this.snmpConfigs);

            return(systemThreadPool.GetResults(delegate(System.Collections.ICollection col, object obj)
            {
                SnmpConfiger snmpConfiger = (SnmpConfiger)obj;
                SnmpExecutor snmpExecutor = new DefaultSnmpExecutor(snmpConfiger);
                PropertiesMessage propertiesMessage = null;
                try
                {
                    propertiesMessage = snmpExecutor.GetProperties_ALL();
                    propertiesMessage.CreateTime = createTime;
                    propertiesMessage.IpAddress = snmpConfiger.SnmpConfig.AgentIp;
                    propertiesMessage.PortNums = snmpConfiger.PortNumbers;
                    propertiesMessage.PerPortReading = snmpConfiger.PerPortReading;
                    propertiesMessage.Switchable = snmpConfiger.Switchable;
                    propertiesMessage.SensorNums = snmpConfiger.SensorNumber;
                }
                catch (System.Exception)
                {
                }
                if (propertiesMessage != null)
                {
                    lock (col)
                    {
                        ((System.Collections.Generic.List <PropertiesMessage>)col).Add(propertiesMessage);
                    }
                }
            }));
        }