private InstrumentBaseViewModel getInstBaseVM(string typeStr)
        {
            InstrumentBaseViewModel instBaseVM;

            Uri instIUri  = new Uri(PrototypeUri_.LocalPath + "prototype_" + typeStr + ".xml");
            Uri resultUri = new Uri(PrototypeUri_.LocalPath + "00000000_prototype_" + typeStr + ".xml");

            if (typeStr == "stepDownKI" || typeStr == "multiNameCDS")
            {
                InstUriInfo   instUriInfo   = new InstUriInfo("", "", instIUri);
                ResultUriInfo resultUriInfo = new ResultUriInfo("", "", resultUri);

                instBaseVM = new StandardInstBaseViewModel(instUriInfo);
                instBaseVM.ReferenceDate_ = PositionSingletonManger.referenceDate();
                instBaseVM.ResultUri_     = resultUriInfo;

                return(instBaseVM);
            }
            else
            {
                InstUriInfo instUriInfo = new InstUriInfo("", "", new Uri(""));
                instBaseVM = new NoExistInstrumentBaseViewModel(instUriInfo);
                return(instBaseVM);
            }
        }
        private InstrumentBaseViewModel getInstBaseVM(string typeStr)
        { 
            InstrumentBaseViewModel instBaseVM;

            Uri instIUri = new Uri(PrototypeUri_.LocalPath + "prototype_" + typeStr + ".xml");
            Uri resultUri = new Uri(PrototypeUri_.LocalPath + "00000000_prototype_" + typeStr + ".xml");

            if (typeStr == "stepDownKI" || typeStr == "multiNameCDS")
            {
                InstUriInfo instUriInfo = new InstUriInfo("", "", instIUri);
                ResultUriInfo resultUriInfo = new ResultUriInfo("", "", resultUri);

                instBaseVM = new StandardInstBaseViewModel(instUriInfo);
                instBaseVM.ReferenceDate_ = PositionSingletonManger.referenceDate();
                instBaseVM.ResultUri_ = resultUriInfo;

                return instBaseVM;
            }
            else
            {
                InstUriInfo instUriInfo = new InstUriInfo("", "", new Uri(""));
                instBaseVM = new NoExistInstrumentBaseViewModel(instUriInfo);
                return instBaseVM;
            }
        }
        public void makeParameter()
        {
            this.positionLoad();

            this.loadedParameter_ = new Dictionary<string, string>();

            // monte
            foreach (var item in this.PositionList_)
            {
                string itemCode = item;

                StandardInstBaseViewModel standInstBaseVM = new StandardInstBaseViewModel(new InstUriInfo());

                standInstBaseVM.ReferenceDate_ = this.ReferenceDate_;
                standInstBaseVM.ItemCode_ = itemCode;
                standInstBaseVM.ItemType_ = "stepDownKI";

                Standard_paraViewModel stand_paraVM = new Standard_paraViewModel();

                MonteViewModel methodVM = new MonteViewModel();
                methodVM.SimulationNum_ = Convert.ToString(30000);

                stand_paraVM.MethodViewModel_ = methodVM;

                stand_paraVM.CalculationAmountViewModel_ = this.calculationVM(itemCode);
                stand_paraVM.UnderlyingInfo_paraViewModel_ = this.underInfo_paraVM(itemCode);
                stand_paraVM.DiscountCurve_paraViewModel_ = this.discount_paraVM(itemCode);

                standInstBaseVM.PricingParameterViewModel_ = stand_paraVM;

                standInstBaseVM.buildPara();

                string kk = standInstBaseVM.ParaResultXml_.InnerXml;
                this.loadedParameter_.Add(itemCode, kk);

                //StringBuilder sb = new StringBuilder();
                //XmlWriterSettings setting = new XmlWriterSettings();

                //setting.Indent = true;
                //setting.Encoding = Encoding.UTF8;
                //XmlWriter xmlWriter = XmlWriter.Create(sb, setting);

                //standInstBaseVM.ParaResultXml_.Save(xmlWriter);
                
                //this.loadedParameter_.Add(itemCode, sb.ToString());

                //this.loadedParameter_.Add(itemCode, standInstBaseVM.ParaResultXml_.InnerXml);
                //loadedParameter_.Add(itemCode,
            }
            
        }
        public void makeParameter()
        {
            this.positionLoad();

            this.loadedParameter_ = new Dictionary <string, string>();

            // monte
            foreach (var item in this.PositionList_)
            {
                string itemCode = item;

                StandardInstBaseViewModel standInstBaseVM = new StandardInstBaseViewModel(new InstUriInfo());

                standInstBaseVM.ReferenceDate_ = this.ReferenceDate_;
                standInstBaseVM.ItemCode_      = itemCode;
                standInstBaseVM.ItemType_      = "stepDownKI";

                Standard_paraViewModel stand_paraVM = new Standard_paraViewModel();

                MonteViewModel methodVM = new MonteViewModel();
                methodVM.SimulationNum_ = Convert.ToString(30000);

                stand_paraVM.MethodViewModel_ = methodVM;

                stand_paraVM.CalculationAmountViewModel_   = this.calculationVM(itemCode);
                stand_paraVM.UnderlyingInfo_paraViewModel_ = this.underInfo_paraVM(itemCode);
                stand_paraVM.DiscountCurve_paraViewModel_  = this.discount_paraVM(itemCode);

                standInstBaseVM.PricingParameterViewModel_ = stand_paraVM;

                standInstBaseVM.buildPara();

                string kk = standInstBaseVM.ParaResultXml_.InnerXml;
                this.loadedParameter_.Add(itemCode, kk);

                //StringBuilder sb = new StringBuilder();
                //XmlWriterSettings setting = new XmlWriterSettings();

                //setting.Indent = true;
                //setting.Encoding = Encoding.UTF8;
                //XmlWriter xmlWriter = XmlWriter.Create(sb, setting);

                //standInstBaseVM.ParaResultXml_.Save(xmlWriter);

                //this.loadedParameter_.Add(itemCode, sb.ToString());

                //this.loadedParameter_.Add(itemCode, standInstBaseVM.ParaResultXml_.InnerXml);
                //loadedParameter_.Add(itemCode,
            }
        }
        private void addUnderFromPosition(InstPositionWrapperVM instPositionWrapperVM)
        {
            StandardInstBaseViewModel stand = instPositionWrapperVM.InstBaseVM_ as StandardInstBaseViewModel;

            UnderlyingViewModel underlyingVM = stand.InstrumentViewModel_.getUnderlying();

            // inst에서 하던under 로 하던 나중에 결정하자으

            bool pickFlag = this.underlyingPickerViewModel_.pickUnderlying(underlyingVM);

            if (pickFlag)
            {
                GreekUnderlyingResultWrapperViewModel greekWrapperVM = new GreekUnderlyingResultWrapperViewModel(underlyingVM);
                this.greekWrapperVMList_.Add(greekWrapperVM);
            }
        }
Пример #6
0
 private void ViewModelChanged(object sender, DependencyPropertyChangedEventArgs e)
 {
     this.ViewModel_ = this.DataContext as StandardInstBaseViewModel;
     this.ReferenceDatePicker_.DataContext = this.viewModel_;
     this.PositionInfoGrid_.DataContext    = this.viewModel_.InstPositionInfoViewModel_;
 }
 private void ViewModelChanged(object sender, DependencyPropertyChangedEventArgs e)
 {
     this.ViewModel_ = this.DataContext as StandardInstBaseViewModel;
     this.ReferenceDatePicker_.DataContext = this.viewModel_;
     this.PositionInfoGrid_.DataContext = this.viewModel_.InstPositionInfoViewModel_;
 }