コード例 #1
0
        private void buttonEditServerAddress_Click(object sender, EventArgs e)
        {
            // Prevent the button from getting focus, place focus on the form instead
            mainForm.Focus();

            MainFormBlur mainFormBlur = new MainFormBlur(mainForm);

            mainFormBlur.Show(mainForm);

            using (GetTextValueDialog dialog = new GetTextValueDialog("Edit Server Address", "Server address (SDK)", "00.000.00.000:00000"))
            {
                if (dialog.ShowDialog() == DialogResult.OK)
                {
                    string hostname = dialog.Result.Split(':')[0];
                    string port     = dialog.Result.Split(':')[1];

                    labelServerAdress.Text = dialog.Result;

                    Properties.Settings.Default.ServerIP   = hostname;
                    Properties.Settings.Default.ServerPort = port;
                    Properties.Settings.Default.Save();
                }
            }

            mainFormBlur.Close();
        }
コード例 #2
0
        private void buttonEditNickname_Click(object sender, EventArgs e)
        {
            // Prevent the button from getting focus, place focus on the form instead
            mainForm.Focus();

            MainFormBlur mainFormBlur = new MainFormBlur(mainForm);

            mainFormBlur.Show(mainForm);

            using (GetTextValueDialog dialog = new GetTextValueDialog("Edit Nickname", "Nickname"))
            {
                if (dialog.ShowDialog() == DialogResult.OK)
                {
                    string nickname = dialog.Result;
                    labelClientNickname.Text = nickname;

                    Properties.Settings.Default.Username = nickname;
                    Properties.Settings.Default.Save();

                    tSClient.GetSelfClient().Nickname = nickname;
                }
            }

            mainFormBlur.Close();
        }
コード例 #3
0
        private void buttonEditChatRoomUrl_Click(object sender, EventArgs e)
        {
            // Prevent the button from getting focus, place focus on the form instead
            mainForm.Focus();

            MainFormBlur mainFormBlur = new MainFormBlur(mainForm);

            mainFormBlur.Show(mainForm);

            using (GetTextValueDialog dialog = new GetTextValueDialog("Edit Chatroom URL", "Chatroom URL", allowEmptyImput: true))
            {
                if (dialog.ShowDialog() == DialogResult.OK)
                {
                    string url = dialog.Result;

                    labelChatRoomUrl.Text = url;

                    mainForm.SetChatroomUrl(channel, url);
                }
            }

            mainFormBlur.Close();
        }
コード例 #4
0
        private void buttonEditDefaultChannelPassword_Click(object sender, EventArgs e)
        {
            // Prevent the button from getting focus, place focus on the form instead
            mainForm.Focus();

            MainFormBlur mainFormBlur = new MainFormBlur(mainForm);

            mainFormBlur.Show(mainForm);

            using (GetTextValueDialog dialog = new GetTextValueDialog("Edit Default Channel Password", "Default channel password", allowEmptyImput: true))
            {
                if (dialog.ShowDialog() == DialogResult.OK)
                {
                    string password = dialog.Result;
                    labelDefaultChannelPassword.Text = password;

                    Properties.Settings.Default.DefaultChannelPassword = password;
                    Properties.Settings.Default.Save();
                }
            }

            mainFormBlur.Close();
        }
コード例 #5
0
        private void buttonEditChannelName_Click(object sender, EventArgs e)
        {
            // Prevent the button from getting focus, place focus on the form instead
            mainForm.Focus();

            MainFormBlur mainFormBlur = new MainFormBlur(mainForm);

            mainFormBlur.Show(mainForm);

            using (GetTextValueDialog dialog = new GetTextValueDialog("Edit Channel Name", "Channel Name"))
            {
                if (dialog.ShowDialog() == DialogResult.OK)
                {
                    string name = dialog.Result;

                    labelChannelName.Text = name;

                    // Update channel name is list
                    foreach (ChannelListChannel channelListChannel in mainForm.channelList.channelListChannels)
                    {
                        if (channelListChannel.channel.Name == channel.Name)
                        {
                            channelListChannel.UpdateName(name);
                        }
                    }

                    // Update channelName on server
                    channel.Name = name;

                    // Update channelName on channelheader
                    mainForm.currentChannelHeader.UpdateName(name);
                }
            }

            mainFormBlur.Close();
        }