Пример #1
0
        /// <summary>
        /// Creates a new XML RPC fault instance from the specified XML element.
        /// </summary>
        /// <param name="element">The XML element.</param>
        /// <param name="format">The format.</param>
        public XmlRpcFault(XElement element, IFormatProvider format)
        {
            if (element.Name.LocalName != XmlRpcFault.xmlFault) throw new XmlRpcException(string.Format("Invalid \'{0}\' XML element name \'{1}\'.", XmlRpcFault.xmlFault, element.Name.LocalName));

            XmlRpcStruct structFault = new XmlRpcValue(element.Elements(XmlRpcFault.xmlValue).FirstOrDefault(), format).Value as XmlRpcStruct;

            this.FaultCode = (structFault[XmlRpcFault.xmlFaultCode].Value.Value as XmlRpcInt).Value;
            this.FaultString = (structFault[XmlRpcFault.xmlFaultString].Value.Value as XmlRpcString).Value;
        }
Пример #2
0
 /// <summary>
 /// Compares this object with the specified argument.
 /// </summary>
 /// <param name="obj">The object to compare with.</param>
 /// <returns><b>True</b> if the two objects are equal, <b>false</b> otherwise.</returns>
 public bool Equals(XmlRpcValue obj)
 {
     return this.Value.Equals(obj.Value);
 }