예제 #1
0
 public virtual void ReadFrom(XElement xE)
 {
     DisapprovalReasons = null;
     PolicyDataType     = null;
     foreach (var xItem in xE.Elements())
     {
         var localName = xItem.Name.LocalName;
         if (localName == "disapprovalReasons")
         {
             if (DisapprovalReasons == null)
             {
                 DisapprovalReasons = new List <DisapprovalReason>();
             }
             var disapprovalReasonsItem = new DisapprovalReason();
             disapprovalReasonsItem.ReadFrom(xItem);
             DisapprovalReasons.Add(disapprovalReasonsItem);
         }
         else if (localName == "PolicyData.Type")
         {
             PolicyDataType = xItem.Value;
         }
     }
 }
예제 #2
0
 public virtual void ReadFrom(XElement xE)
 {
     AdGroupId               = null;
     Ad                      = null;
     Status                  = null;
     ApprovalStatus          = null;
     Trademarks              = null;
     DisapprovalReasons      = null;
     TrademarkDisapproved    = null;
     Labels                  = null;
     BaseCampaignId          = null;
     BaseAdGroupId           = null;
     ForwardCompatibilityMap = null;
     foreach (var xItem in xE.Elements())
     {
         var localName = xItem.Name.LocalName;
         if (localName == "adGroupId")
         {
             AdGroupId = long.Parse(xItem.Value);
         }
         else if (localName == "ad")
         {
             Ad = InstanceCreator.CreateAd(xItem);
             Ad.ReadFrom(xItem);
         }
         else if (localName == "status")
         {
             Status = AdGroupAdStatusExtensions.Parse(xItem.Value);
         }
         else if (localName == "approvalStatus")
         {
             ApprovalStatus = AdGroupAdApprovalStatusExtensions.Parse(xItem.Value);
         }
         else if (localName == "trademarks")
         {
             if (Trademarks == null)
             {
                 Trademarks = new List <string>();
             }
             Trademarks.Add(xItem.Value);
         }
         else if (localName == "disapprovalReasons")
         {
             if (DisapprovalReasons == null)
             {
                 DisapprovalReasons = new List <string>();
             }
             DisapprovalReasons.Add(xItem.Value);
         }
         else if (localName == "trademarkDisapproved")
         {
             TrademarkDisapproved = bool.Parse(xItem.Value);
         }
         else if (localName == "labels")
         {
             if (Labels == null)
             {
                 Labels = new List <Label>();
             }
             var labelsItem = InstanceCreator.CreateLabel(xItem);
             labelsItem.ReadFrom(xItem);
             Labels.Add(labelsItem);
         }
         else if (localName == "baseCampaignId")
         {
             BaseCampaignId = long.Parse(xItem.Value);
         }
         else if (localName == "baseAdGroupId")
         {
             BaseAdGroupId = long.Parse(xItem.Value);
         }
         else if (localName == "forwardCompatibilityMap")
         {
             if (ForwardCompatibilityMap == null)
             {
                 ForwardCompatibilityMap = new List <String_StringMapEntry>();
             }
             var forwardCompatibilityMapItem = new String_StringMapEntry();
             forwardCompatibilityMapItem.ReadFrom(xItem);
             ForwardCompatibilityMap.Add(forwardCompatibilityMapItem);
         }
     }
 }
예제 #3
0
 public override void ReadFrom(XElement xE)
 {
     base.ReadFrom(xE);
     UserStatus                   = null;
     SystemServingStatus          = null;
     ApprovalStatus               = null;
     DisapprovalReasons           = null;
     DestinationUrl               = null;
     FirstPageCpc                 = null;
     TopOfPageCpc                 = null;
     FirstPositionCpc             = null;
     QualityInfo                  = null;
     BiddingStrategyConfiguration = null;
     BidModifier                  = null;
     FinalUrls           = null;
     FinalMobileUrls     = null;
     FinalAppUrls        = null;
     TrackingUrlTemplate = null;
     UrlCustomParameters = null;
     foreach (var xItem in xE.Elements())
     {
         var localName = xItem.Name.LocalName;
         if (localName == "userStatus")
         {
             UserStatus = UserStatusExtensions.Parse(xItem.Value);
         }
         else if (localName == "systemServingStatus")
         {
             SystemServingStatus = SystemServingStatusExtensions.Parse(xItem.Value);
         }
         else if (localName == "approvalStatus")
         {
             ApprovalStatus = ApprovalStatusExtensions.Parse(xItem.Value);
         }
         else if (localName == "disapprovalReasons")
         {
             if (DisapprovalReasons == null)
             {
                 DisapprovalReasons = new List <string>();
             }
             DisapprovalReasons.Add(xItem.Value);
         }
         else if (localName == "destinationUrl")
         {
             DestinationUrl = xItem.Value;
         }
         else if (localName == "firstPageCpc")
         {
             FirstPageCpc = new Bid();
             FirstPageCpc.ReadFrom(xItem);
         }
         else if (localName == "topOfPageCpc")
         {
             TopOfPageCpc = new Bid();
             TopOfPageCpc.ReadFrom(xItem);
         }
         else if (localName == "firstPositionCpc")
         {
             FirstPositionCpc = new Bid();
             FirstPositionCpc.ReadFrom(xItem);
         }
         else if (localName == "qualityInfo")
         {
             QualityInfo = new QualityInfo();
             QualityInfo.ReadFrom(xItem);
         }
         else if (localName == "biddingStrategyConfiguration")
         {
             BiddingStrategyConfiguration = new BiddingStrategyConfiguration();
             BiddingStrategyConfiguration.ReadFrom(xItem);
         }
         else if (localName == "bidModifier")
         {
             BidModifier = double.Parse(xItem.Value);
         }
         else if (localName == "finalUrls")
         {
             FinalUrls = new UrlList();
             FinalUrls.ReadFrom(xItem);
         }
         else if (localName == "finalMobileUrls")
         {
             FinalMobileUrls = new UrlList();
             FinalMobileUrls.ReadFrom(xItem);
         }
         else if (localName == "finalAppUrls")
         {
             FinalAppUrls = new AppUrlList();
             FinalAppUrls.ReadFrom(xItem);
         }
         else if (localName == "trackingUrlTemplate")
         {
             TrackingUrlTemplate = xItem.Value;
         }
         else if (localName == "urlCustomParameters")
         {
             UrlCustomParameters = new CustomParameters();
             UrlCustomParameters.ReadFrom(xItem);
         }
     }
 }