public virtual void ReadFrom(XElement xE) { BiddingStrategyId = null; BiddingStrategyName = null; BiddingStrategyType = null; BiddingStrategySource = null; BiddingScheme = null; Bids = null; foreach (var xItem in xE.Elements()) { var localName = xItem.Name.LocalName; if (localName == "biddingStrategyId") { BiddingStrategyId = long.Parse(xItem.Value); } else if (localName == "biddingStrategyName") { BiddingStrategyName = xItem.Value; } else if (localName == "biddingStrategyType") { BiddingStrategyType = BiddingStrategyTypeExtensions.Parse(xItem.Value); } else if (localName == "biddingStrategySource") { BiddingStrategySource = BiddingStrategySourceExtensions.Parse(xItem.Value); } else if (localName == "biddingScheme") { BiddingScheme = InstanceCreator.CreateBiddingScheme(xItem); BiddingScheme.ReadFrom(xItem); } else if (localName == "bids") { if (Bids == null) { Bids = new List <Bids>(); } var bidsItem = InstanceCreator.CreateBids(xItem); bidsItem.ReadFrom(xItem); Bids.Add(bidsItem); } } }
public virtual void ReadFrom(XElement xE) { BiddingScheme = null; Id = null; Name = null; Status = null; Type = null; SystemStatus = null; foreach (var xItem in xE.Elements()) { var localName = xItem.Name.LocalName; if (localName == "biddingScheme") { BiddingScheme = InstanceCreator.CreateBiddingScheme(xItem); BiddingScheme.ReadFrom(xItem); } else if (localName == "id") { Id = long.Parse(xItem.Value); } else if (localName == "name") { Name = xItem.Value; } else if (localName == "status") { Status = SharedBiddingStrategyBiddingStrategyStatusExtensions.Parse(xItem.Value); } else if (localName == "type") { Type = BiddingStrategyTypeExtensions.Parse(xItem.Value); } else if (localName == "systemStatus") { SystemStatus = BiddingStrategySystemStatusExtensions.Parse(xItem.Value); } } }