public ChannelStack(Limit<int> sizeLimit) { _sizeLimit = sizeLimit; _main = new Channel("main", ChannelVisibility.Public); _stack = new List<Channel> { _main }; _stackSize = 1; _channels = new Dictionary<string, Channel> { { "main", _main } }; }
public void PushChannel(string channelName, ChannelVisibility visibility) { Channel ch; if (!_channels.TryGetValue(channelName, out ch)) { ch = new Channel(channelName, visibility); _channels[channelName] = ch; } if (channelName == "main") return; ch.Visiblity = visibility; if (_stack.Contains(ch)) return; _stack.Add(ch); _stackSize++; }