public Omega(int value)
 {
     if (value == 1)
     {
         iDontKnowHowToNameIt = new Alpha();
     }
     else if (value == 2)
     {
         iDontKnowHowToNameIt = new Beta();
     }
     else
     {
         throw new ArgumentException("Wrong value passed");
     }
 }
Пример #2
0
        protected void UpdateInfo()
        {
            State.SetState(OInterface.OperationalStatus);
            Name    = OInterface.Name + " (" + State.Text + ")";
            NetMask = "";
            Text    = OInterface.Name;

            if (!State.Up)
            {
                Ip    = "0.0.0.0";
                Mbps  = 0;
                Text += "\rDown";
                return;
            }


            Mbps = (OInterface.Speed / 1000000);

            ipProperties = OInterface.GetIPProperties();

            adressId = -1;

            if (ipProperties.UnicastAddresses.Count < 1)
            {
                Ip = "0.0.0.0";
            }
            else if ((ipProperties.UnicastAddresses.Count > 1) && (null != ipProperties.UnicastAddresses[1].Address))
            {
                adressId = 1;
            }
            else
            {
                adressId = 0;
            }

            if (adressId > -1)
            {
                Ip = ipProperties.UnicastAddresses[adressId].Address.ToString();
                if (null != (ipProperties.UnicastAddresses[adressId].IPv4Mask))
                {
                    NetMask = ipProperties.UnicastAddresses[adressId].IPv4Mask.ToString();
                }
            }

            Text += "\r" + Ip + "\r" + NetMask + "\r" + Mbps.ToString() + " Mbps";
        }