Example #1
0
 public static TradeQuotesViewModel GetInstance(MainViewModel mainVM)
 {
     if (_instance == null)
     {
         _instance = new TradeQuotesViewModel(mainVM);
     }
     return(_instance);
 }
Example #2
0
 public void ScrollIntoView(SysCodeModel stock)
 {
     if (stock == null || (_mainVM.SelectItemViewModel != null && string.Equals(_mainVM.SelectItemViewModel.ContractCode, stock.SystemName)))
     {
         return;
     }
     if (!TradeQuotesViewModel.GetInstance(null).IsInternationalCheck)
     {
         TradeQuotesViewModel.GetInstance(null).InternationalCheckType = 1;
         TradeQuotesViewModel.GetInstance(null).IsInternationalCheck   = true;
     }
     ContractChanged?.Invoke(stock, EventArgs.Empty);
 }
Example #3
0
        public void ExecuteRevcAddOptionalData(object para)
        {
            ResultOptionalContractModel pm = para as ResultOptionalContractModel;

            if (pm != null)
            {
                if (pm.errcode == 0)
                {
                    if (pm.content != null)
                    {
                        TradeInfoHelper.OptionalModelList.Add(pm.content);
                        TradeQuotesViewModel.GetInstance(null).AddOptionalData(pm.content);
                    }
                }
            }
        }
Example #4
0
        public void ExecuteRevcDelOptionalData(object para)
        {
            ResultOptionalContractModel pm = para as ResultOptionalContractModel;

            if (pm != null)
            {
                if (pm.errcode == 0)
                {
                    if (pm.content != null)
                    {
                        var model = TradeInfoHelper.OptionalModelList.FirstOrDefault(o => string.Equals(o.serial_number, pm.content.serial_number));
                        if (model != null)
                        {
                            TradeInfoHelper.OptionalModelList.Remove(model);
                            TradeQuotesViewModel.GetInstance(null).DelOptionalData(model);
                        }
                    }
                }
            }
        }