예제 #1
0
 public Dictionary <string, object> ToDictionary()
 {
     return(new Dictionary <string, object>
     {
         { "ConnectionName", ConnectionName }
         , { "DHCPEnabled", DHCPEnabled.ToString() }
         , { "IPAddresses", IPAddresses.ToDictionary(k => k.Index, v => v.Value) }
     });
 }
예제 #2
0
        public override string ToString()
        {
            var  sb      = new StringBuilder("RuyiNetworkSettings(");
            bool __first = true;

            if (Connection != null && __isset.connection)
            {
                if (!__first)
                {
                    sb.Append(", ");
                }
                __first = false;
                sb.Append("Connection: ");
                sb.Append(Connection == null ? "<null>" : Connection.ToString());
            }
            if (NetworkType != null && __isset.networkType)
            {
                if (!__first)
                {
                    sb.Append(", ");
                }
                __first = false;
                sb.Append("NetworkType: ");
                sb.Append(NetworkType == null ? "<null>" : NetworkType.ToString());
            }
            if (Quality != null && __isset.quality)
            {
                if (!__first)
                {
                    sb.Append(", ");
                }
                __first = false;
                sb.Append("Quality: ");
                sb.Append(Quality == null ? "<null>" : Quality.ToString());
            }
            if (SSID != null && __isset.SSID)
            {
                if (!__first)
                {
                    sb.Append(", ");
                }
                __first = false;
                sb.Append("SSID: ");
                sb.Append(SSID == null ? "<null>" : SSID.ToString());
            }
            if (BSSID != null && __isset.BSSID)
            {
                if (!__first)
                {
                    sb.Append(", ");
                }
                __first = false;
                sb.Append("BSSID: ");
                sb.Append(BSSID == null ? "<null>" : BSSID.ToString());
            }
            if (Authentication != null && __isset.Authentication)
            {
                if (!__first)
                {
                    sb.Append(", ");
                }
                __first = false;
                sb.Append("Authentication: ");
                sb.Append(Authentication == null ? "<null>" : Authentication.ToString());
            }
            if (DHCPEnabled != null && __isset.DHCPEnabled)
            {
                if (!__first)
                {
                    sb.Append(", ");
                }
                __first = false;
                sb.Append("DHCPEnabled: ");
                sb.Append(DHCPEnabled == null ? "<null>" : DHCPEnabled.ToString());
            }
            if (IpAddress != null && __isset.IpAddress)
            {
                if (!__first)
                {
                    sb.Append(", ");
                }
                __first = false;
                sb.Append("IpAddress: ");
                sb.Append(IpAddress == null ? "<null>" : IpAddress.ToString());
            }
            if (SubMask != null && __isset.SubMask)
            {
                if (!__first)
                {
                    sb.Append(", ");
                }
                __first = false;
                sb.Append("SubMask: ");
                sb.Append(SubMask == null ? "<null>" : SubMask.ToString());
            }
            if (Gateway != null && __isset.Gateway)
            {
                if (!__first)
                {
                    sb.Append(", ");
                }
                __first = false;
                sb.Append("Gateway: ");
                sb.Append(Gateway == null ? "<null>" : Gateway.ToString());
            }
            if (MainDNS != null && __isset.MainDNS)
            {
                if (!__first)
                {
                    sb.Append(", ");
                }
                __first = false;
                sb.Append("MainDNS: ");
                sb.Append(MainDNS == null ? "<null>" : MainDNS.ToString());
            }
            if (SubDNS != null && __isset.SubDNS)
            {
                if (!__first)
                {
                    sb.Append(", ");
                }
                __first = false;
                sb.Append("SubDNS: ");
                sb.Append(SubDNS == null ? "<null>" : SubDNS.ToString());
            }
            if (MacAddress != null && __isset.MacAddress)
            {
                if (!__first)
                {
                    sb.Append(", ");
                }
                __first = false;
                sb.Append("MacAddress: ");
                sb.Append(MacAddress == null ? "<null>" : MacAddress.ToString());
            }
            if (Proxy != null && __isset.Proxy)
            {
                if (!__first)
                {
                    sb.Append(", ");
                }
                __first = false;
                sb.Append("Proxy: ");
                sb.Append(Proxy == null ? "<null>" : Proxy.ToString());
            }
            sb.Append(")");
            return(sb.ToString());
        }