Пример #1
0
 /// <summary>
 /// Adds a new channel and sets this new one to the current
 /// </summary>
 /// <param name="channelName">the name of the new channel</param>
 public void AddChannel(string channelName)
 {
     if (channels[channelName] == null)
     {
         OutputChannel channel = new OutputChannel(channelName);
         channels.Add(channel);
         comboBox.Items.Add(channelName);
         currentChannel         = channels[channelName];
         current                = channelName;
         comboBox.SelectedIndex = comboBox.Items.Count - 1;               //the last added
         channel.OnNewOutput   += new EventHandler <ChannelEventArgs>(channel_OnNewOutput);
         channel.OnClear       += new EventHandler <StringEventArgs>(channel_OnClear);
         if (OnChannelAdded != null)
         {
             OnChannelAdded(this, new StringEventArgs(channelName));
         }
     }
 }