public void Serialize <TValue>(UnchangableExpression <TValue> expression, String name, IJsonWriter writer, CalculationTicket ticket) { writer.Write(name, delegate { var value = expression.Value(ticket); var issues = expression.Validate(ticket); expression.Adapter.Take(new Write_NamedValueAdapter("value", writer), value); this.validationSerializer.SerializeValidationIssuesIfAny(issues, writer); }); }
public SecurityModel( ISecurity security, EditableExpression baseExpression, UnchangableExpression <Decimal> benchmark, IEnumerable <PortfolioTargetModel> portfolioTargets, Expression <Decimal?> baseActiveExpression ) { this.Security = security; this.Base = baseExpression; this.Benchmark = benchmark; this.PortfolioTargets = portfolioTargets.ToList(); this.BaseActive = baseActiveExpression; }
public UnsavedBasketCountryModel( Country country, UnchangableExpression <Decimal> benchmarkExpression, EditableExpression baseExpression, Func <UnsavedBasketCountryModel, IExpression <Decimal?> > baseActiveExpressionCreator, UnchangableExpression <Decimal> overlayExpression, EditableExpression portfolioAdjustmentExpression, Func <UnsavedBasketCountryModel, IExpression <Decimal?> > portfolioScaledExpressionCreator, Func <UnsavedBasketCountryModel, IExpression <Decimal?> > trueExposureExpressionCreator, Func <UnsavedBasketCountryModel, IExpression <Decimal?> > trueActiveExpressionCreator, BasketCountryModel basketCountry ) : this(country, benchmarkExpression, baseExpression, baseActiveExpressionCreator, overlayExpression, portfolioAdjustmentExpression, portfolioScaledExpressionCreator, trueExposureExpressionCreator, trueActiveExpressionCreator) { this.BasketCountry = basketCountry; }
public BasketCountryModel( CountryBasket basket, UnchangableExpression <Decimal> benchmarkExpression, EditableExpression baseExpression, Func <BasketCountryModel, IExpression <Decimal?> > baseActiveExpressionCreator, UnchangableExpression <Decimal> overlayExpression, EditableExpression portfolioAdjustmentExpression, Func <BasketCountryModel, IExpression <Decimal?> > portfolioScaledExpressionCreator, Func <BasketCountryModel, IExpression <Decimal?> > trueExposureExpressionCreator, Func <BasketCountryModel, IExpression <Decimal?> > trueActiveExpressionCreator, CommonParts commonParts ) { this.Basket = basket; this.Benchmark = benchmarkExpression; this.Base = baseExpression; this.BaseActive = baseActiveExpressionCreator(this); this.Overlay = overlayExpression; this.PortfolioAdjustment = portfolioAdjustmentExpression; this.PortfolioScaled = portfolioScaledExpressionCreator(this); this.TrueExposure = trueExposureExpressionCreator(this); this.TrueActive = trueActiveExpressionCreator(this); }
public UnsavedBasketCountryModel( Country country, UnchangableExpression <Decimal> benchmarkExpression, EditableExpression baseExpression, Func <UnsavedBasketCountryModel, IExpression <Decimal?> > baseActiveExpressionCreator, UnchangableExpression <Decimal> overlayExpression, EditableExpression portfolioAdjustmentExpression, Func <UnsavedBasketCountryModel, IExpression <Decimal?> > portfolioScaledExpressionCreator, Func <UnsavedBasketCountryModel, IExpression <Decimal?> > trueExposureExpressionCreator, Func <UnsavedBasketCountryModel, IExpression <Decimal?> > trueActiveExpressionCreator ) { this.BasketId = null; this.Country = country; this.Benchmark = benchmarkExpression; this.Base = baseExpression; this.BaseActive = baseActiveExpressionCreator(this); this.Overlay = overlayExpression; this.PortfolioAdjustment = portfolioAdjustmentExpression; this.PortfolioScaled = portfolioScaledExpressionCreator(this); this.TrueExposure = trueExposureExpressionCreator(this); this.TrueActive = trueActiveExpressionCreator(this); }
public void Resolve(UnchangableExpression <TValue> expression) { this.parent.Serialize(expression, this.name, this.writer, this.ticket); }
public BaseActiveFormula(EditableExpression baseExpression, UnchangableExpression <Decimal> benchmarkExpression) { this.BaseExpression = baseExpression; this.BenchmarkExpression = benchmarkExpression; }
public Expression <Decimal?> CreateBaseActiveExpression(EditableExpression baseExpression, UnchangableExpression <decimal> benchmarkExpression) { return(new Expression <decimal?>(ValueNames.BaseActive, new BaseActiveFormula(baseExpression, benchmarkExpression), this.commonParts.NullableDecimalValueAdapter, this.commonParts.ValidateWhatever)); }
public void Resolve <TValue>(UnchangableExpression <TValue> expression) { this.Result = false; }
public void PopulateUnchangeableExpression <TValue>(JsonReader reader, UnchangableExpression <TValue> expression) { expression.InitialValue = expression.Adapter.Give(new JsonPropertyValueGiver(JsonNames.Value, reader)); }