コード例 #1
0
ファイル: ChannelStack.cs プロジェクト: 2hp/Processus
        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 }
            };
        }
コード例 #2
0
ファイル: ChannelStack.cs プロジェクト: 2hp/Processus
        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++;
        }