/// <summary>
 ///   發送訂閱完畢的事件通知
 /// </summary>
 /// <param name="e">QuoteComplementEvent類別</param>
 protected void OnSubscribeCompleted(QuoteComplementCompletedEvent e)
 {
     if (onSubscribeCompleted != null)
     {
         Task.Factory.StartNew(() => {
             onSubscribeCompleted(this, e);
         });
     }
 }
Esempio n. 2
0
        private void QuoteService_onCompleted(object sender, QuoteComplementCompletedEvent e)
        {
            AbstractQuoteService cService = QuoteManager.Manager.GetQuoteService(e.DataSource);
            IQuote cQuote = cService.Storage.GetQuote(e.SymbolId);

            if (cQuote != null)
            {
                QuoteUpdate(e.ExchangeName, e.DataSource, cQuote);                  //更新報價
                RefreshGrid();
            }
        }
Esempio n. 3
0
		private void QuoteService_onComplementCompleted(object sender, QuoteComplementCompletedEvent e) {
			_AsyncEventArgs cArgs = null;
			string sHashKey = string.Format("{0}_{1}", e.DataSource, e.SymbolId);
			lock (__cAsyncArgs) {
				if (__cAsyncArgs.TryGetValue(sHashKey, out cArgs)) {
					__cAsyncArgs.Remove(sHashKey);
				}
			}

			if (cArgs != null) {
				EventWaitHandle cWaitHandle = cArgs.handle;
				if (cWaitHandle != null) {
					cWaitHandle.Set();
					cWaitHandle.Dispose();
				}
			}
		}