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); }
// 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); }
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); }
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); } }
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; } }