Beispiel #1
0
 public void AppendRule(RuleDto rule)
 {
     if (OptionalList == null)
     {
         OptionalList = new List <RuleDto>();
     }
     OptionalList.Add(rule);
 }
Beispiel #2
0
        public void AddOptionalData(OptionalContractModel item)
        {
            int seq       = TradeInfoHelper.OptionalModelList.Count;
            var datamodel = TradeInfoHelper.ContractModelList.FirstOrDefault(o => string.Equals(o.contractCode, item.contract_id));

            if (datamodel != null)
            {
                var viewModel = new FuturesViewModel(datamodel);
                viewModel.Seq                  = seq;
                viewModel.IsOptionalStock      = true;
                viewModel.OptionalSerialNumber = item.serial_number;
                QuotationEntity quotesmodel = null;
                lock (TradeInfoHelper.SubscribedContractList)
                {
                    quotesmodel = TradeInfoHelper.SubscribedContractList.FirstOrDefault(o => string.Equals(o.cd, item.contract_id));
                }
                if (quotesmodel != null)
                {
                    ScoketManager.GetInstance().UpdateModelInfo(viewModel, quotesmodel);
                }
                OptionalList.Add(viewModel);
                SetOptionalList();
            }
        }