示例#1
0
        private void Channels_SelectedIndexChanged(object sender, EventArgs e)
        {
            this.MessagesBox.Text = "";
            ChannelItem chan = (ChannelItem)Channels.SelectedItem;

            if (chan != null)
            {
                ChatManager.Instance.showSelectedChannel(chan.Name);
            }
        }
示例#2
0
        public void ModifyChannelName(ChannelItem channelItem, String newName)
        {
            if (Channels.Items.Contains(channelItem))
            {
                channelItem.Name = newName;

                //Refresh the listbox
                Channels.DisplayMember = "";
                Channels.DisplayMember = "ChannelItem";
            }
        }
示例#3
0
        public void StarOnChannel(ChannelItem channelItem, Boolean needStar)
        {
            if (Channels.Items.Contains(channelItem))
            {
                channelItem.NewMessage = needStar;

                //Refresh the listbox
                Channels.DisplayMember = "";
                Channels.DisplayMember = "ChannelItem";
            }
        }
示例#4
0
        public void DeleteChannel(ChannelItem channelItem)
        {
            if ((channelItem != null) && Channels.Items.Contains(channelItem))
            {
                Channels.Items.Remove(channelItem);

                if (Channels.SelectedItem == null)
                {
                    Channels.SelectedIndex = 0;
                }

                //Refresh the listbox
                Channels.DisplayMember = "";
                Channels.DisplayMember = "ChannelItem";
            }
        }
示例#5
0
 public void addChannelItem(ChannelItem channelItem)
 {
     this.Channels.Items.Add(channelItem);
 }
示例#6
0
        private void DeleteChannelButton_Click(object sender, EventArgs e)
        {
            ChannelItem chan = (ChannelItem)Channels.SelectedItem;

            ChatManager.Instance.askDeleteChannel(chan.Name);
        }
示例#7
0
        public String getSelectedChannel()
        {
            ChannelItem chan = (ChannelItem)this.Channels.SelectedItem;

            return(chan.Name);
        }