Пример #1
0
 public virtual void ReadFrom(XElement xE)
 {
     ConversionTypeIds    = null;
     ConversionTypeIdsOps = null;
     foreach (var xItem in xE.Elements())
     {
         var localName = xItem.Name.LocalName;
         if (localName == "conversionTypeIds")
         {
             if (ConversionTypeIds == null)
             {
                 ConversionTypeIds = new List <long>();
             }
             ConversionTypeIds.Add(long.Parse(xItem.Value));
         }
         else if (localName == "conversionTypeIdsOps")
         {
             ConversionTypeIdsOps = new ListOperations();
             ConversionTypeIdsOps.ReadFrom(xItem);
         }
     }
 }
Пример #2
0
 public override void ReadFrom(XElement xE)
 {
     base.ReadFrom(xE);
     AppId                = null;
     Description1         = null;
     Description2         = null;
     Description3         = null;
     Description4         = null;
     YoutubeVideoMediaIds = null;
     ImageMediaIds        = null;
     UniversalAppBiddingStrategyGoalType = null;
     YoutubeVideoMediaIdsOps             = null;
     ImageMediaIdsOps   = null;
     AdsPolicyDecisions = null;
     foreach (var xItem in xE.Elements())
     {
         var localName = xItem.Name.LocalName;
         if (localName == "appId")
         {
             AppId = xItem.Value;
         }
         else if (localName == "description1")
         {
             Description1 = xItem.Value;
         }
         else if (localName == "description2")
         {
             Description2 = xItem.Value;
         }
         else if (localName == "description3")
         {
             Description3 = xItem.Value;
         }
         else if (localName == "description4")
         {
             Description4 = xItem.Value;
         }
         else if (localName == "youtubeVideoMediaIds")
         {
             if (YoutubeVideoMediaIds == null)
             {
                 YoutubeVideoMediaIds = new List <long>();
             }
             YoutubeVideoMediaIds.Add(long.Parse(xItem.Value));
         }
         else if (localName == "imageMediaIds")
         {
             if (ImageMediaIds == null)
             {
                 ImageMediaIds = new List <long>();
             }
             ImageMediaIds.Add(long.Parse(xItem.Value));
         }
         else if (localName == "universalAppBiddingStrategyGoalType")
         {
             UniversalAppBiddingStrategyGoalType = UniversalAppBiddingStrategyGoalTypeExtensions.Parse(xItem.Value);
         }
         else if (localName == "youtubeVideoMediaIdsOps")
         {
             YoutubeVideoMediaIdsOps = new ListOperations();
             YoutubeVideoMediaIdsOps.ReadFrom(xItem);
         }
         else if (localName == "imageMediaIdsOps")
         {
             ImageMediaIdsOps = new ListOperations();
             ImageMediaIdsOps.ReadFrom(xItem);
         }
         else if (localName == "adsPolicyDecisions")
         {
             if (AdsPolicyDecisions == null)
             {
                 AdsPolicyDecisions = new List <UniversalAppCampaignAdsPolicyDecisions>();
             }
             var adsPolicyDecisionsItem = new UniversalAppCampaignAdsPolicyDecisions();
             adsPolicyDecisionsItem.ReadFrom(xItem);
             AdsPolicyDecisions.Add(adsPolicyDecisionsItem);
         }
     }
 }