示例#1
0
 private void SetProperties(NamedValueSet properties)
 {
     try
     {
         var baseDate = PropertyHelper.ExtractDateTimeProperty(CurveProp.BaseDate, properties);
         if (baseDate != null)
         {
             BaseDate = (DateTime)baseDate;
         }
         Id = PropertyHelper.ExtractStringProperty("AssetId", properties);
         //AssetType property - make sure it exists.
         var assetType = PropertyHelper.ExtractStringProperty("AssetType", properties);
         if (assetType != null)
         {
             AssetType = EnumHelper.Parse <AssetTypesEnum>(assetType);
         }
         Coupon           = PropertyHelper.ExtractDecimalProperty("Coupon", properties);
         MaturityDate     = PropertyHelper.ExtractDateTimeProperty("Maturity", properties);
         UniqueIdentifier = properties.GetValue <string>(CurveProp.UniqueIdentifier) ?? BuildUniqueId();
         PropertyHelper.Update(Properties, CurveProp.UniqueIdentifier, UniqueIdentifier);
     }
     catch
     {
         throw new System.Exception("Invalid assetid.");
     }
 }