ToXMLFragment() protected method

XML fragment representation of this object
Name for outer tag expected to be set by calling method. This fragment returns inner properties representation only
protected ToXMLFragment ( ) : String
return String
示例#1
0
        /// <summary>
        /// XML fragment representation of this object
        /// </summary>
        /// <returns>XML fragment for this object.</returns>
        /// <remarks>
        /// Name for outer tag expected to be set by calling method.
        /// This fragment returns inner properties representation only
        /// </remarks>


        protected internal String ToXMLFragment()
        {
            StringBuilder xml = new StringBuilder();

            if (IsSetCompetitivePrices())
            {
                CompetitivePriceList competitivePricesObj = this.CompetitivePrices;
                xml.Append("<CompetitivePrices>");
                xml.Append(competitivePricesObj.ToXMLFragment());
                xml.Append("</CompetitivePrices>");
            }
            if (IsSetNumberOfOfferListings())
            {
                NumberOfOfferListingsList numberOfOfferListingsObj = this.NumberOfOfferListings;
                xml.Append("<NumberOfOfferListings>");
                xml.Append(numberOfOfferListingsObj.ToXMLFragment());
                xml.Append("</NumberOfOfferListings>");
            }
            if (IsSetTradeInValue())
            {
                MoneyType tradeInValueObj = this.TradeInValue;
                xml.Append("<TradeInValue>");
                xml.Append(tradeInValueObj.ToXMLFragment());
                xml.Append("</TradeInValue>");
            }
            return(xml.ToString());
        }