public void UpdateAdditionlaInfo() { var newAddtionalInfo = new List <ProductInfo>(); if (EnableTarget) { newAddtionalInfo.AddRange(ListManager.Instance.TargetingRecods.MergeSet(AddtionalInfo)); } if (EnableRichMedia) { newAddtionalInfo.AddRange(ListManager.Instance.RichMediaRecods.MergeSet(AddtionalInfo)); } AddtionalInfo.Clear(); AddtionalInfo.AddRange(newAddtionalInfo); }
public void Dispose() { Websites.Clear(); AddtionalInfo.Clear(); PackageRecord.Dispose(); PackageRecord = null; AdPlanSettings.Dispose(); AdPlanSettings = null; OutputData.Dispose(); OutputData = null; Parent = null; }
public Lyric(IOrderedEnumerable <Slice> orderedEnumerable, List <KeyValuePair <string, string> > enumerable) { this.Slices = orderedEnumerable; this.AddtionalInfo = enumerable; foreach (var item in AddtionalInfo) { if (item.Key.Equals("offset", StringComparison.CurrentCultureIgnoreCase)) { if (int.TryParse(item.Value, out int i)) { Offset = TimeSpan.FromMilliseconds(i); AddtionalInfo.Remove(item); break; } } } }
public void Deserialize(XmlNode node) { int tempInt; decimal tempDecimal; foreach (XmlAttribute productAttribute in node.Attributes) { switch (productAttribute.Name) { #region Basic Properties case "Name": Name = productAttribute.Value; break; case "UniqueID": Guid tempGuid; if (Guid.TryParse(productAttribute.Value, out tempGuid)) { UniqueID = tempGuid; } break; case "Index": if (int.TryParse(productAttribute.Value, out tempInt)) { Index = tempInt; } break; case "Category": Category = productAttribute.Value; break; case "SubCategory": SubCategory = productAttribute.Value; break; case "RateType": RateType = productAttribute.Value; switch (RateType) { case "0": RateType = "CPM"; break; case "1": RateType = "Fixed"; break; } break; case "Location": Location = productAttribute.Value; break; case "Width": if (int.TryParse(productAttribute.Value, out tempInt)) { Width = tempInt; } else { Width = null; } break; case "Height": if (int.TryParse(productAttribute.Value, out tempInt)) { Height = tempInt; } else { Height = null; } break; case "EnableTarget": { bool temp; if (Boolean.TryParse(productAttribute.Value, out temp)) { EnableTarget = temp; } } break; case "EnableLocation": { bool temp; if (Boolean.TryParse(productAttribute.Value, out temp)) { EnableLocation = temp; } } break; case "EnableRichMedia": { bool temp; if (Boolean.TryParse(productAttribute.Value, out temp)) { EnableRichMedia = temp; } } break; #endregion #region Additional Properties case "UserDefinedName": UserDefinedName = productAttribute.Value; break; case "DurationType": DurationType = productAttribute.Value; break; case "DurationValue": if (int.TryParse(productAttribute.Value, out tempInt)) { DurationValue = tempInt; } else { DurationValue = null; } break; case "Strength1": Strength1 = productAttribute.Value; break; case "Strength2": Strength2 = productAttribute.Value; break; case "MonthlyInvestment": if (Decimal.TryParse(productAttribute.Value, out tempDecimal)) { MonthlyInvestment = tempDecimal; } else { MonthlyInvestment = null; } break; case "MonthlyImpressions": if (Decimal.TryParse(productAttribute.Value, out tempDecimal)) { MonthlyImpressions = tempDecimal; } else { MonthlyImpressions = null; } break; case "MonthlyCPM": if (Decimal.TryParse(productAttribute.Value, out tempDecimal)) { MonthlyCPM = tempDecimal; } else { MonthlyCPM = null; } break; case "TotalInvestment": if (Decimal.TryParse(productAttribute.Value, out tempDecimal)) { TotalInvestment = tempDecimal; } else { TotalInvestment = null; } break; case "TotalImpressions": if (Decimal.TryParse(productAttribute.Value, out tempDecimal)) { TotalImpressions = tempDecimal; } else { TotalImpressions = null; } break; case "TotalCPM": if (Decimal.TryParse(productAttribute.Value, out tempDecimal)) { TotalCPM = tempDecimal; } else { TotalCPM = null; } break; case "DefaultRate": if (Decimal.TryParse(productAttribute.Value, out tempDecimal)) { DefaultRate = tempDecimal; } else { DefaultRate = null; } break; case "Formula": if (int.TryParse(productAttribute.Value, out tempInt)) { Formula = (FormulaType)tempInt; } break; case "InvestmentDetails": InvestmentDetails = productAttribute.Value; break; case "EnableComment": { bool tempBool; if (bool.TryParse(productAttribute.Value, out tempBool)) { EnableComment = tempBool; } } break; case "CommentManualEdit": { bool tempBool; if (bool.TryParse(productAttribute.Value, out tempBool)) { CommentManualEdit = tempBool; } } break; case "ShowCommentTargeting": { bool temp; if (Boolean.TryParse(productAttribute.Value, out temp)) { ShowCommentTargeting = temp; } } break; case "ShowCommentRichMedia": { bool temp; if (Boolean.TryParse(productAttribute.Value, out temp)) { ShowCommentRichMedia = temp; } } break; case "Comment": _userComment = productAttribute.Value; break; case "DescriptionManualEdit": { bool tempBool; if (bool.TryParse(productAttribute.Value, out tempBool)) { DescriptionManualEdit = tempBool; } } break; case "ShowDimensions": { bool temp; if (Boolean.TryParse(productAttribute.Value, out temp)) { ShowDimensions = temp; } } break; case "ShowDescriptionTargeting": { bool temp; if (Boolean.TryParse(productAttribute.Value, out temp)) { ShowDescriptionTargeting = temp; } } break; case "ShowDescriptionRichMedia": { bool temp; if (Boolean.TryParse(productAttribute.Value, out temp)) { ShowDescriptionRichMedia = temp; } } break; case "Description": Description = productAttribute.Value; break; case "UserDescription": _userDescription = productAttribute.Value; break; #endregion #region Show Properties case "ShowFlightDates": { bool tempBool; if (bool.TryParse(productAttribute.Value, out tempBool)) { ShowFlightDates = tempBool; } } break; case "ShowDuration": { bool tempBool; if (bool.TryParse(productAttribute.Value, out tempBool)) { ShowDuration = tempBool; } } break; case "ShowAllPricingMonthly": { bool tempBool; if (bool.TryParse(productAttribute.Value, out tempBool)) { ShowAllPricingMonthly = tempBool; } } break; case "ShowAllPricingTotal": { bool tempBool; if (bool.TryParse(productAttribute.Value, out tempBool)) { ShowAllPricingTotal = tempBool; } } break; case "ShowMonthlyInvestments": { bool tempBool; if (bool.TryParse(productAttribute.Value, out tempBool)) { ShowMonthlyInvestments = tempBool; } } break; case "ShowMonthlyImpressions": { bool tempBool; if (bool.TryParse(productAttribute.Value, out tempBool)) { ShowMonthlyImpressions = tempBool; } } break; case "ShowTotalInvestments": { bool tempBool; if (bool.TryParse(productAttribute.Value, out tempBool)) { ShowTotalInvestments = tempBool; } } break; case "ShowTotalImpressions": { bool tempBool; if (bool.TryParse(productAttribute.Value, out tempBool)) { ShowTotalImpressions = tempBool; } } break; #endregion } } Websites.Clear(); foreach (XmlNode childNode in node.ChildNodes) { switch (childNode.Name) { case "Website": Websites.Add(childNode.InnerText); break; case "PackageRecord": PackageRecord.Deserialize(childNode); break; case "SummaryItem": SummaryItem.Deserialize(childNode); break; case "ProductInfo": var productInfo = new ProductInfo(); productInfo.Deserialize(childNode); AddtionalInfo.Add(productInfo); break; } } }