// チャンネルのプロパティ private void channelProparity() { if (channelIndex < 0 || channelIndex >= channelArray.Count) { return; } ChatChannel cc = (ChatChannel)channelArray[channelIndex]; ChannelPropertyForm dlg = new ChannelPropertyForm(); dlg.TextBoxKey.Text = cc.Key; dlg.TextBoxPath.Text = cc.ChannelPath; dlg.TextBoxChannelName.Text = cc.ChannelName; dlg.TextBoxName.Text = cc.NickName; dlg.TextBoxLogPath.Text = cc.LogPath; if (dlg.ShowDialog() == DialogResult.OK) { cc.Dispose(); cc = new ChatChannel(dlg.TextBoxChannelName.Text, dlg.TextBoxName.Text, dlg.TextBoxPath.Text, dlg.TextBoxKey.Text, dlg.TextBoxLogPath.Text); channelArray[this.channelIndex] = cc; saveConfiguration(); updateChannelList(); updateView(); } dlg.Dispose(); }
// チャンネル追加 private void chanelAdd() { ChannelPropertyForm dlg = new ChannelPropertyForm(); dlg.TextBoxKey.Text = defaultChannelKey; dlg.TextBoxPath.Text = ""; dlg.TextBoxChannelName.Text = ""; dlg.TextBoxName.Text = Environment.UserName; dlg.TextBoxLogPath.Text = ""; if (dlg.ShowDialog() == DialogResult.OK) { ChatChannel cc = new ChatChannel(dlg.TextBoxChannelName.Text, dlg.TextBoxName.Text, dlg.TextBoxPath.Text, dlg.TextBoxKey.Text, dlg.TextBoxLogPath.Text); this.channelIndex = channelArray.Add(cc); saveConfiguration(); updateChannelList(); updateView(); } dlg.Dispose(); }