示例#1
0
        private void OnStorageChanged(string storageName, SecurityIdMapping mapping)
        {
            if (!StorageName.CompareIgnoreCase(storageName))
            {
                return;
            }

            // if adapter code is empty means mapping removed
            // also mapping can be changed (new adapter code for old security code)

            lock (_syncRoot)
            {
                _securityIds.RemoveByValue(mapping.StockSharpId);
                _securityIds.Add(mapping.StockSharpId, mapping.AdapterId);
            }
        }
        private void OnStorageNewIdentifierAdded(string storageName, SecurityId securityId, object nativeId)
        {
            if (!StorageName.CompareIgnoreCase(storageName))
            {
                return;
            }

            bool added;

            lock (_syncRoot)
                added = _securityIds.TryAdd(nativeId, securityId);

            if (added)
            {
                var temp = securityId;
                temp.Native = nativeId;
                RaiseNewOutMessage(new ProcessSuspendedSecurityMessage(this, temp));
            }
        }