public virtual void ReadFrom(XElement xE) { Header = null; Description = null; FinalUrls = null; Price = null; PriceUnit = null; foreach (var xItem in xE.Elements()) { var localName = xItem.Name.LocalName; if (localName == "header") { Header = xItem.Value; } else if (localName == "description") { Description = xItem.Value; } else if (localName == "finalUrls") { FinalUrls = new UrlList(); FinalUrls.ReadFrom(xItem); } else if (localName == "price") { Price = new MoneyWithCurrency(); Price.ReadFrom(xItem); } else if (localName == "priceUnit") { PriceUnit = PriceExtensionPriceUnitExtensions.Parse(xItem.Value); } } }
public override void ReadFrom(XElement xE) { base.ReadFrom(xE); SitelinkText = null; SitelinkUrl = null; SitelinkLine2 = null; SitelinkLine3 = null; SitelinkFinalUrls = null; SitelinkFinalMobileUrls = null; SitelinkTrackingUrlTemplate = null; SitelinkUrlCustomParameters = null; foreach (var xItem in xE.Elements()) { var localName = xItem.Name.LocalName; if (localName == "sitelinkText") { SitelinkText = xItem.Value; } else if (localName == "sitelinkUrl") { SitelinkUrl = xItem.Value; } else if (localName == "sitelinkLine2") { SitelinkLine2 = xItem.Value; } else if (localName == "sitelinkLine3") { SitelinkLine3 = xItem.Value; } else if (localName == "sitelinkFinalUrls") { SitelinkFinalUrls = new UrlList(); SitelinkFinalUrls.ReadFrom(xItem); } else if (localName == "sitelinkFinalMobileUrls") { SitelinkFinalMobileUrls = new UrlList(); SitelinkFinalMobileUrls.ReadFrom(xItem); } else if (localName == "sitelinkTrackingUrlTemplate") { SitelinkTrackingUrlTemplate = xItem.Value; } else if (localName == "sitelinkUrlCustomParameters") { SitelinkUrlCustomParameters = new CustomParameters(); SitelinkUrlCustomParameters.ReadFrom(xItem); } } }
public override void ReadFrom(XElement xE) { base.ReadFrom(xE); AppStore = null; AppId = null; AppLinkText = null; AppUrl = null; AppFinalUrls = null; AppFinalMobileUrls = null; AppTrackingUrlTemplate = null; AppUrlCustomParameters = null; foreach (var xItem in xE.Elements()) { var localName = xItem.Name.LocalName; if (localName == "appStore") { AppStore = AppFeedItemAppStoreExtensions.Parse(xItem.Value); } else if (localName == "appId") { AppId = xItem.Value; } else if (localName == "appLinkText") { AppLinkText = xItem.Value; } else if (localName == "appUrl") { AppUrl = xItem.Value; } else if (localName == "appFinalUrls") { AppFinalUrls = new UrlList(); AppFinalUrls.ReadFrom(xItem); } else if (localName == "appFinalMobileUrls") { AppFinalMobileUrls = new UrlList(); AppFinalMobileUrls.ReadFrom(xItem); } else if (localName == "appTrackingUrlTemplate") { AppTrackingUrlTemplate = xItem.Value; } else if (localName == "appUrlCustomParameters") { AppUrlCustomParameters = new CustomParameters(); AppUrlCustomParameters.ReadFrom(xItem); } } }
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); } } }