Beispiel #1
0
        public override void setFromSerial(FpmlSerializedCSharp.ISerialized serial_Class)
        {
            FpmlSerializedCSharp.ReturnCalculation         serial_ReturnCalculation         = serial_Class as FpmlSerializedCSharp.ReturnCalculation;
            FpmlSerializedCSharp.CallPutCompositeReturnCal serial_CallPutCompositeReturnCal = serial_ReturnCalculation.CallPutCompositeReturnCal_;

            this.weight_ = new ObservableCollection <string>();

            foreach (var item in serial_CallPutCompositeReturnCal.Weight_)
            {
                this.weight_.Add(item.ValueStr);
            }

            FpmlSerializedCSharp.ReferenceCalculationInfo serial_referenceCalculationInfo = serial_CallPutCompositeReturnCal.ReferenceCalculationInfo_;
            this.referenceCalculationInfoViewModel_.setFromSerial(serial_referenceCalculationInfo);

            List <FpmlSerializedCSharp.OptionPayoffFunction> serial_optionPayoffFunction = serial_CallPutCompositeReturnCal.OptionPayoffFunction_;

            this.optionPayoffFunctionViewModel_ = new ObservableCollection <OptionPayoffFunctionViewModel>();
            foreach (var item in serial_optionPayoffFunction)
            {
                string type = item.Type_.ValueStr;
                OptionPayoffFunctionViewModel viewModel = OptionPayoffFunctionViewModel.CreateOptionPayoffFunction(type);
                viewModel.setFromSerial(item);
                this.optionPayoffFunctionViewModel_.Add(viewModel);
            }

            //this.view_ = new CallPutCompositeReturnCalView();
            //this.view_.DataContext = this;
        }
Beispiel #2
0
        public static OptionPayoffFunctionViewModel CreateOptionPayoffFunction(FpmlSerializedCSharp.ISerialized serial_Class)
        {
            FpmlSerializedCSharp.OptionPayoffFunction serial_OptionPayoffFunction = serial_Class as FpmlSerializedCSharp.OptionPayoffFunction;
            string typeStr = serial_OptionPayoffFunction.Type_.ValueStr;

            return(OptionPayoffFunctionViewModel.CreateOptionPayoffFunction(typeStr));
        }