GetXmlRpcType() public static method

public static GetXmlRpcType ( Type t ) : XmlRpcType
t System.Type
return XmlRpcType
コード例 #1
0
 public override void Add(object key, object value)
 {
     if (!(key is string))
     {
         throw new ArgumentException("XmlRpcStruct key must be a string.");
     }
     if (XmlRpcServiceInfo.GetXmlRpcType(value.GetType())
         == XmlRpcType.tInvalid)
     {
         throw new ArgumentException(String.Format(
                                         "Type {0} cannot be mapped to an XML-RPC type", value.GetType()));
     }
     base.Add(key, value);
 }
コード例 #2
0
ファイル: XmlRpcStruct.cs プロジェクト: zanybaka/ljArchive
 // TODO: add constructor with params args
 public override void Add(object key, object value)
 {
     if (!(key is string))
     {
         throw new Exception();
     }
     if (XmlRpcServiceInfo.GetXmlRpcType(value.GetType())
         == XmlRpcType.tInvalid)
     {
         //!! include value type in message?
         throw new Exception();
     }
     base.Add(key, value);
 }
コード例 #3
0
        public override void Add(object key, object value)
        {
            if (!(key is string))
            {
                throw new ArgumentException("XmlRpcStruct key must be a string.");
            }

            if (value != null && XmlRpcServiceInfo.GetXmlRpcType(value.GetType())
                == XmlRpcType.tInvalid)
            {
                throw new ArgumentException($"Type {value.GetType()} cannot be mapped to an XML-RPC type");
            }

            base.Add(key, value);
            _keys.Add(key);
            _values.Add(value);
        }
コード例 #4
0
 public override object this[object key]
 {
     get => base[key];
     set
     {
         if (!(key is string))
         {
             throw new ArgumentException("XmlRpcStruct key must be a string.");
         }
         if (XmlRpcServiceInfo.GetXmlRpcType(value.GetType())
             == XmlRpcType.tInvalid)
         {
             throw new ArgumentException($"Type {value.GetType()} cannot be mapped to an XML-RPC type");
         }
         base[key] = value;
         _keys.Add(key);
         _values.Add(value);
     }
 }
コード例 #5
0
 public override object this[object key]
 {
     get
     {
         return(base[key]);
     }
     set
     {
         if (!(key is string))
         {
             throw new ArgumentException("XmlRpcStruct key must be a string.");
         }
         if (XmlRpcServiceInfo.GetXmlRpcType(value.GetType())
             == XmlRpcType.tInvalid)
         {
             throw new ArgumentException(String.Format(
                                             "Type {0} cannot be mapped to an XML-RPC type", value.GetType()));
         }
         base[key] = value;
     }
 }