SteamChatBot.Triggers.TriggerOptions.Windows.ChatCommandApiWindow.button_Click C# (CSharp) Method

button_Click() private method

private button_Click ( object sender, RoutedEventArgs e ) : void
sender object
e System.Windows.RoutedEventArgs
return void
        private void button_Click(object sender, RoutedEventArgs e)
        {
            if (apiBox.Text == "")
            {
                MessageBox.Show("You must include an API key", "Error", MessageBoxButton.OK, MessageBoxImage.Error, MessageBoxResult.OK);
            }
            else
            {
                ccw.ShowDialog();
                if (ccw.DialogResult.HasValue && ccw.DialogResult == true)
                {
                    CC = ccw.CC;
                    CCA = new ChatCommandApi()
                    {
                        Name = CC.Name,
                        ApiKey = "",
                        ChatCommand = new ChatCommand()
                    };

                    if (apiBox.Text == "")
                    {
                        MessageBox.Show("You must include an API key.", "Error", MessageBoxButton.OK, MessageBoxImage.Information, MessageBoxResult.OK);
                    }
                    else
                    {
                        CCA.ApiKey = apiBox.Text;
                    }

                    DialogResult = true;
                    Close();
                }
            }
        }