Ejemplo n.º 1
0
        public DnsSetting(IPInterfaceProperties interfaceProperties)
        {
            IsDynamicDnsEnabled = interfaceProperties.IsDynamicDnsEnabled;

            if (interfaceProperties.DnsAddresses.Count == 0)
            {
                PrimaryDns   = new IpV4Address();
                SecondaryDns = new IpV4Address();
            }
            else
            {
                PrimaryDns   = new IpV4Address(interfaceProperties.DnsAddresses[0]);
                SecondaryDns = new IpV4Address(interfaceProperties.DnsAddresses[interfaceProperties.DnsAddresses.Count > 1 ? 1 : 0]);
            }
        }
Ejemplo n.º 2
0
        public DnsSetting(IPInterfaceProperties interfaceProperties)
        {
            try
            {
                IsDynamicDnsEnabled = interfaceProperties.IsDynamicDnsEnabled;
            }
            catch (PlatformNotSupportedException)
            {
                IsDynamicDnsEnabled = false;
            }

            if (interfaceProperties.DnsAddresses.Count == 0)
            {
                PrimaryDns   = new IpV4Address();
                SecondaryDns = new IpV4Address();
            }
            else
            {
                PrimaryDns   = new IpV4Address(interfaceProperties.DnsAddresses[0]);
                SecondaryDns = new IpV4Address(interfaceProperties.DnsAddresses[interfaceProperties.DnsAddresses.Count > 1 ? 1 : 0]);
            }
        }
Ejemplo n.º 3
0
 public DnsSetting(IPInterfaceProperties interfaceProperties)
 {
     IsDynamicDnsEnabled = interfaceProperties.IsDynamicDnsEnabled;
     PrimaryDns          = new IpV4Address(interfaceProperties.DnsAddresses[0]);
     SecondaryDns        = new IpV4Address(interfaceProperties.DnsAddresses[1]);
 }