Пример #1
0
        private static AddOnFixedAmount ReadAddOnFixedAmount(EntryObject o)
        {
            if (o.InitialMarginModel != "SIMM")
            {
                throw new InvalidDataException("The CRIF file contains a Param_AddOnFixedAmount entry with the IMModel property not set to \"SIMM\".");
            }

            foreach (String property in s_Properties.Except(s_PropertiesAmount.Union(s_PropertiesCommon)))
            {
                if (!String.IsNullOrEmpty((String)o.GetType().GetProperty(property)?.GetValue(o)))
                {
                    throw new InvalidDataException($"The CRIF file cannot specify the {property} property for Param_AddOnFixedAmount entries.");
                }
            }

            Amount          amount          = ReadAmount(o);
            RegulationsInfo regulationsInfo = ReadRegulationsInfo(o);

            return(AddOnFixedAmount.OfUnchecked(amount, regulationsInfo));
        }