using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace MarketData.Generator.TermStructure { public class CurveData { public CurveData() { ;} public String CurveName{get;set;} public DateTime PricingDate { get; set; } public Tenors CurveTenors { get; set; } public String GetTenorValue(String tenorName) { try { int index=CurveTenors.FindIndex(x => x.Item.Equals(tenorName)); if (-1 == index || index >= CurveTenors.Count) return null; return CurveTenors[index].Value; } catch (Exception /*exception*/) { return null; } } public void RemoveTenors(String strTenors) { string[] strTenorArray = strTenors.Split(','); foreach (String strTenor in strTenorArray) { CurveTenors.Remove(strTenor); } } } // *************************************************************8 public class CurveMappings : List { public CurveMappings() { } } public class CurveMapping { public CurveMapping() { } public String CurveName { get; set; } public String Currency { get; set; } public String BloombergMnemonic { get; set; } public String Field { get; set; } public String AttributeName { get; set; } public String CurveId { get; set; } public Tenors TenorMappings{get;set;} public DateTime PricingDate { get; set; } public void SetTenorValues(String strValues) { String[] strTenorValues = strValues.Split(','); if (strTenorValues.Length != TenorMappings.Count) throw new Exception("Tenor mapping count does not match tenor value count"); for (int index = 0; index < TenorMappings.Count; index++) { TenorMappings[index].Value = strTenorValues[index]; } } } public class Tenors : List { public Tenors() { } public void Remove(String strTenor) { for(int index=0;index