Exemple #1
0
        public override void WriteTo(XElement xE)
        {
            base.WriteTo(xE);
            XmlUtility.SetXsiType(xE, "https://adwords.google.com/api/adwords/cm/v201609", "CpcBid");
            XElement xItem = null;

            if (Bid != null)
            {
                xItem = new XElement(XName.Get("bid", "https://adwords.google.com/api/adwords/cm/v201609"));
                Bid.WriteTo(xItem);
                xE.Add(xItem);
            }
            if (CpcBidSource != null)
            {
                xItem = new XElement(XName.Get("cpcBidSource", "https://adwords.google.com/api/adwords/cm/v201609"));
                xItem.Add(CpcBidSource.Value.ToXmlValue());
                xE.Add(xItem);
            }
        }
Exemple #2
0
        public virtual void WriteTo(XElement xE)
        {
            XElement xItem = null;

            if (Bid != null)
            {
                xItem = new XElement(XName.Get("bid", "https://adwords.google.com/api/adwords/cm/v201609"));
                Bid.WriteTo(xItem);
                xE.Add(xItem);
            }
            if (Clicks != null)
            {
                xItem = new XElement(XName.Get("clicks", "https://adwords.google.com/api/adwords/cm/v201609"));
                xItem.Add(Clicks.Value.ToString());
                xE.Add(xItem);
            }
            if (Cost != null)
            {
                xItem = new XElement(XName.Get("cost", "https://adwords.google.com/api/adwords/cm/v201609"));
                Cost.WriteTo(xItem);
                xE.Add(xItem);
            }
            if (Impressions != null)
            {
                xItem = new XElement(XName.Get("impressions", "https://adwords.google.com/api/adwords/cm/v201609"));
                xItem.Add(Impressions.Value.ToString());
                xE.Add(xItem);
            }
            if (PromotedImpressions != null)
            {
                xItem = new XElement(XName.Get("promotedImpressions", "https://adwords.google.com/api/adwords/cm/v201609"));
                xItem.Add(PromotedImpressions.Value.ToString());
                xE.Add(xItem);
            }
            if (RequiredBudget != null)
            {
                xItem = new XElement(XName.Get("requiredBudget", "https://adwords.google.com/api/adwords/cm/v201609"));
                RequiredBudget.WriteTo(xItem);
                xE.Add(xItem);
            }
            if (BidModifier != null)
            {
                xItem = new XElement(XName.Get("bidModifier", "https://adwords.google.com/api/adwords/cm/v201609"));
                xItem.Add(BidModifier.Value.ToString());
                xE.Add(xItem);
            }
            if (TotalLocalImpressions != null)
            {
                xItem = new XElement(XName.Get("totalLocalImpressions", "https://adwords.google.com/api/adwords/cm/v201609"));
                xItem.Add(TotalLocalImpressions.Value.ToString());
                xE.Add(xItem);
            }
            if (TotalLocalClicks != null)
            {
                xItem = new XElement(XName.Get("totalLocalClicks", "https://adwords.google.com/api/adwords/cm/v201609"));
                xItem.Add(TotalLocalClicks.Value.ToString());
                xE.Add(xItem);
            }
            if (TotalLocalCost != null)
            {
                xItem = new XElement(XName.Get("totalLocalCost", "https://adwords.google.com/api/adwords/cm/v201609"));
                TotalLocalCost.WriteTo(xItem);
                xE.Add(xItem);
            }
            if (TotalLocalPromotedImpressions != null)
            {
                xItem = new XElement(XName.Get("totalLocalPromotedImpressions", "https://adwords.google.com/api/adwords/cm/v201609"));
                xItem.Add(TotalLocalPromotedImpressions.Value.ToString());
                xE.Add(xItem);
            }
        }