private void Channels_SelectedIndexChanged(object sender, EventArgs e) { this.MessagesBox.Text = ""; ChannelItem chan = (ChannelItem)Channels.SelectedItem; if (chan != null) { ChatManager.Instance.showSelectedChannel(chan.Name); } }
public void ModifyChannelName(ChannelItem channelItem, String newName) { if (Channels.Items.Contains(channelItem)) { channelItem.Name = newName; //Refresh the listbox Channels.DisplayMember = ""; Channels.DisplayMember = "ChannelItem"; } }
public void StarOnChannel(ChannelItem channelItem, Boolean needStar) { if (Channels.Items.Contains(channelItem)) { channelItem.NewMessage = needStar; //Refresh the listbox Channels.DisplayMember = ""; Channels.DisplayMember = "ChannelItem"; } }
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"; } }
public void addChannelItem(ChannelItem channelItem) { this.Channels.Items.Add(channelItem); }
private void DeleteChannelButton_Click(object sender, EventArgs e) { ChannelItem chan = (ChannelItem)Channels.SelectedItem; ChatManager.Instance.askDeleteChannel(chan.Name); }
public String getSelectedChannel() { ChannelItem chan = (ChannelItem)this.Channels.SelectedItem; return(chan.Name); }