Ejemplo n.º 1
0
        private void newTargetPlatformSelected(object sender, SelectionChangedEventArgs e)
        {
            ComboBoxItem cbi = (comboTargetPlatform.SelectedItem as ComboBoxItem);

            if (cbi == null)
            {
                return;
            }

            string currentSelection = cbi.Content.ToString();

            Debug.WriteLine(currentSelection);

            if (currentSelection == "-NEW ENTRY-")
            {
                string newTarget = MessageBoxHandler.showEntryBox("Special Target Platform", "Enter New Target Platform Name", "Submit");

                if (string.IsNullOrEmpty(newTarget) || string.IsNullOrWhiteSpace(newTarget))
                {
                    System.Media.SystemSounds.Exclamation.Play();
                    MessageBoxHandler.showMessageBox("Entries can NOT be empty!", "Blank Input", "Sowwy ;w;");
                    MessageBoxHandler.showMessageBox("All is good", "Forgiveness", "♥");
                    comboTargetPlatform.SelectedIndex = 0;
                    return;
                }
                else
                {
                    ComboBoxItem newItem = new ComboBoxItem();
                    newItem.Content = newTarget;
                    comboTargetPlatform.Items.Add(newItem);
                    comboTargetPlatform.SelectedItem = newItem;
                }
            }
        }
Ejemplo n.º 2
0
        private void btnDeleteCharacter_Click(object sender, RoutedEventArgs e)
        {
            if (listboxCharacters.SelectedIndex == -1)
            {
                System.Media.SystemSounds.Exclamation.Play();
                MessageBoxHandler.showMessageBox("You must select a character to delete", "No Character Selected", "Alrighty! ^^♥");
                return;
            }

            listboxCharacters.Items.RemoveAt(listboxCharacters.SelectedIndex);
        }
Ejemplo n.º 3
0
        private void btnAddCharacter_Copy_Click(object sender, RoutedEventArgs e)
        {
            string cName    = (string.IsNullOrEmpty(txtCharacterName.Text)) ? "NULL" : txtCharacterName.Text;
            string cSpecies = (string.IsNullOrEmpty(txtCharacterSpecies.Text)) ? "NULL" : txtCharacterSpecies.Text;

            if (cName == "NULL" && cSpecies == "NULL")
            {
                MessageBoxHandler.showMessageBox("Name and Species can NOT be empty", "Invalid Character", "I'm Sowwy ;w;");
                return;
            }

            listboxCharacters.Items.Add(cName + " - " + cSpecies);
        }