Ejemplo n.º 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);
     _keys.Add(key);
     _values.Add(value);
 }
Ejemplo n.º 2
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;
         _keys.Add(key);
         _values.Add(value);
     }
 }