コード例 #1
0
ファイル: FaultStruct.cs プロジェクト: moayyaed/XmlRpc-2
        /// <summary>
        /// Fills the property of this struct that has the correct name with the information contained in the member-XElement.
        /// </summary>
        /// <param name="member">The member element storing the information.</param>
        /// <returns>Whether it was successful or not.</returns>
        protected override bool parseXml(XElement member)
        {
            XElement value = getMemberValueElement(member);

            switch (getMemberName(member))
            {
            case "faultCode":
                if (!faultCode.ParseXml(value))
                {
                    return(false);
                }
                break;

            case "faultString":
                if (!faultString.ParseXml(value))
                {
                    return(false);
                }
                break;

            default:
                return(false);
            }

            return(true);
        }
コード例 #2
0
        /// <summary>
        /// Fills the property of this struct that has the correct name with the information contained in the member-XElement.
        /// </summary>
        /// <param name="member">The member element storing the information.</param>
        /// <returns>Whether it was successful or not.</returns>
        protected override bool parseXml(XElement member)
        {
            var value = getMemberValueElement(member);

            switch (getMemberName(member))
            {
            case "Login":
                if (!login.ParseXml(value))
                {
                    return(false);
                }
                break;

            case "PlayerId":
                if (!playerId.ParseXml(value))
                {
                    return(false);
                }
                break;

            case "Result":
                if (!result.ParseXml(value))
                {
                    return(false);
                }
                break;

            default:
                return(false);
            }

            return(true);
        }