protected void UnsubTDSuccessAction(PBInstrumentList pbInstList)
 {
     foreach (var contract in pbInstList.Instrument)
     {
         WeakReference <ContractKeyVM> tdVMRef;
         TradingDeskDataMap.TryRemove(new ContractKeyVM(contract.Exchange, contract.Contract), out tdVMRef);
     }
 }
        public ContractKeyVM FindTradingDeskData(ContractKeyVM contract)
        {
            WeakReference <ContractKeyVM> tdVMRef;
            ContractKeyVM tdVM = null;

            if (TradingDeskDataMap.TryGetValue(contract, out tdVMRef))
            {
                tdVMRef.TryGetTarget(out tdVM);
            }

            return(tdVM);
        }
        public void UnsubTradingDeskData(IEnumerable <ContractKeyVM> instList)
        {
            var instrList = new List <ContractKeyVM>();

            foreach (var quoteVM in instList)
            {
                WeakReference <ContractKeyVM> mktData;
                TradingDeskDataMap.TryRemove(quoteVM, out mktData);
                instrList.Add(quoteVM);
            }

            SendMessage(NextSerialId, (uint)BusinessMessageID.MSG_ID_UNSUB_TRADINGDESK_PRICING, instrList);
        }