Ejemplo n.º 1
0
        public ChannelWriter(RantFormat formatStyle, Limit sizeLimit)
        {
            _sizeLimit = sizeLimit;
            _main = new Channel("main", ChannelVisibility.Public, formatStyle, _sizeLimit);

            _stack = new List<Channel> { _main };
            _stackSize = 1;

            _channels = new Dictionary<string, Channel>
            {
                { "main", _main }
            };
        }
Ejemplo n.º 2
0
        public void OpenChannel(string channelName, ChannelVisibility visibility, RantFormat formatStyle)
        {   
            Channel ch;
            if (!_channels.TryGetValue(channelName, out ch))
            {
                ch = new Channel(channelName, visibility, formatStyle, _sizeLimit);
                _channels[channelName] = ch;
            }

            if (channelName == "main") return;

            ch.Visiblity = visibility;

            if (_stack.Contains(ch)) return;
            _stack.Add(ch);
            _stackSize++;
        }