Esempio n. 1
0
        internal SymbolNotificationType GetNotificationType(ISymbol symbol)
        {
            SymbolNotificationType none = SymbolNotificationType.None;
            NotificationSymbolInfo info = null;
            object obj2 = this._sync;

            lock (obj2)
            {
                if (this._notificationSymbolDict.TryGetValue(symbol, out info))
                {
                    none = info.NotificationType;
                }
            }
            return(none);
        }
Esempio n. 2
0
        internal void Update(ISymbol symbol, SymbolNotificationType type, NotificationSettings settings)
        {
            NotificationSymbolInfo info = null;
            object obj2 = this._sync;

            lock (obj2)
            {
                if (!this._notificationSymbolDict.TryGetValue(symbol, out info))
                {
                    throw new ArgumentException("Symbol is not registered for Notifications!");
                }
                info.Settings          = settings;
                info.NotificationType |= type;
            }
        }
Esempio n. 3
0
        internal bool Remove(ISymbol symbol)
        {
            bool flag = false;
            NotificationSymbolInfo info = null;
            object obj2 = this._sync;

            lock (obj2)
            {
                if (this._notificationSymbolDict.TryGetValue(symbol, out info))
                {
                    this._notificationHandleDict.Remove(info.Handle);
                    flag = this._notificationSymbolDict.Remove(info.Symbol);
                }
            }
            return(flag);
        }
Esempio n. 4
0
        internal void Add(ISymbol symbol, int handle, SymbolNotificationType notificationType, NotificationSettings settings)
        {
            NotificationSymbolInfo info = null;
            object obj2 = this._sync;

            lock (obj2)
            {
                if (this._notificationHandleDict.TryGetValue(handle, out info))
                {
                    throw new ArgumentException("Symbol already registered!");
                }
                NotificationSymbolInfo info2 = new NotificationSymbolInfo(symbol, handle, notificationType, settings);
                this._notificationHandleDict.Add(handle, info2);
                this._notificationSymbolDict.Add(symbol, info2);
            }
        }
Esempio n. 5
0
        internal bool TryGetRegisteredNotificationSettings(ISymbol symbol, out NotificationSettings settings)
        {
            bool flag = false;

            settings = null;
            object obj2 = this._sync;

            lock (obj2)
            {
                NotificationSymbolInfo info = null;
                if (this._notificationSymbolDict.TryGetValue(symbol, out info))
                {
                    settings = info.Settings;
                    flag     = true;
                }
            }
            return(flag);
        }
Esempio n. 6
0
        internal bool TryGetNotificationHandle(ISymbol symbol, out int handle)
        {
            bool flag = false;
            NotificationSymbolInfo info = null;

            handle = 0;
            object obj2 = this._sync;

            lock (obj2)
            {
                if (this._notificationSymbolDict.TryGetValue(symbol, out info))
                {
                    handle = info.Handle;
                    flag   = true;
                }
            }
            return(flag);
        }
Esempio n. 7
0
        internal bool Remove(ISymbol symbol, SymbolNotificationType notificationType)
        {
            bool flag = false;
            NotificationSymbolInfo info = null;
            object obj2 = this._sync;

            lock (obj2)
            {
                if (this._notificationSymbolDict.TryGetValue(symbol, out info))
                {
                    SymbolNotificationType type = SymbolNotificationType.Both & ~notificationType;
                    info.NotificationType &= type;
                    if (info.NotificationType == SymbolNotificationType.None)
                    {
                        this._notificationHandleDict.Remove(info.Handle);
                        flag = this._notificationSymbolDict.Remove(symbol);
                    }
                }
            }
            return(flag);
        }