public override void ReadFrom(XElement xE) { base.ReadFrom(xE); Keyword = null; MaxCpc = null; IsNegative = null; foreach (var xItem in xE.Elements()) { var localName = xItem.Name.LocalName; if (localName == "keyword") { Keyword = new Keyword(); Keyword.ReadFrom(xItem); } else if (localName == "maxCpc") { MaxCpc = new Money(); MaxCpc.ReadFrom(xItem); } else if (localName == "isNegative") { IsNegative = bool.Parse(xItem.Value); } } }
public override void ReadFrom(XElement xE) { base.ReadFrom(xE); Value = null; foreach (var xItem in xE.Elements()) { var localName = xItem.Name.LocalName; if (localName == "value") { Value = new Keyword(); Value.ReadFrom(xItem); } } }
public virtual void ReadFrom(XElement xE) { FeedId = null; FeedItemId = null; Status = null; StartTime = null; EndTime = null; AttributeValues = null; PolicyData = null; DevicePreference = null; Scheduling = null; CampaignTargeting = null; AdGroupTargeting = null; KeywordTargeting = null; GeoTargeting = null; GeoTargetingRestriction = null; UrlCustomParameters = null; foreach (var xItem in xE.Elements()) { var localName = xItem.Name.LocalName; if (localName == "feedId") { FeedId = long.Parse(xItem.Value); } else if (localName == "feedItemId") { FeedItemId = long.Parse(xItem.Value); } else if (localName == "status") { Status = FeedItemStatusExtensions.Parse(xItem.Value); } else if (localName == "startTime") { StartTime = xItem.Value; } else if (localName == "endTime") { EndTime = xItem.Value; } else if (localName == "attributeValues") { if (AttributeValues == null) { AttributeValues = new List <FeedItemAttributeValue>(); } var attributeValuesItem = new FeedItemAttributeValue(); attributeValuesItem.ReadFrom(xItem); AttributeValues.Add(attributeValuesItem); } else if (localName == "policyData") { if (PolicyData == null) { PolicyData = new List <FeedItemPolicyData>(); } var policyDataItem = new FeedItemPolicyData(); policyDataItem.ReadFrom(xItem); PolicyData.Add(policyDataItem); } else if (localName == "devicePreference") { DevicePreference = new FeedItemDevicePreference(); DevicePreference.ReadFrom(xItem); } else if (localName == "scheduling") { Scheduling = new FeedItemScheduling(); Scheduling.ReadFrom(xItem); } else if (localName == "campaignTargeting") { CampaignTargeting = new FeedItemCampaignTargeting(); CampaignTargeting.ReadFrom(xItem); } else if (localName == "adGroupTargeting") { AdGroupTargeting = new FeedItemAdGroupTargeting(); AdGroupTargeting.ReadFrom(xItem); } else if (localName == "keywordTargeting") { KeywordTargeting = new Keyword(); KeywordTargeting.ReadFrom(xItem); } else if (localName == "geoTargeting") { GeoTargeting = new Location(); GeoTargeting.ReadFrom(xItem); } else if (localName == "geoTargetingRestriction") { GeoTargetingRestriction = new FeedItemGeoRestriction(); GeoTargetingRestriction.ReadFrom(xItem); } else if (localName == "urlCustomParameters") { UrlCustomParameters = new CustomParameters(); UrlCustomParameters.ReadFrom(xItem); } } }