private void OnSubscribe(Messages.ChannelSubscription data) { try { Channel existing = null; lock (channelLocker) { if (!ChannelList.TryGetValue(data.ChannelId, out existing)) { ChannelList[data.ChannelId] = new BitfinexChannel() { ChannelId = data.ChannelId, Name = data.Channel, Symbol = data.Symbol };; } else { BitfinexChannel typedChannel = existing as BitfinexChannel; typedChannel.Name = data.Channel; typedChannel.ChannelId = data.ChannelId; typedChannel.Symbol = data.Symbol; } } } catch (Exception e) { Log.Error(e); throw; } }