Beispiel #1
0
 /// <summary>
 /// This method updates the NoteTextBox with all notes from the Song list in the main program
 /// </summary>
 public void UpdateNoteBox()
 {
     NoteTextBox.Clear();
     foreach (INote note in Autoplayer.Song)
     {
         if (note is DelayNote)
         {
             NoteTextBox.Text += (((DelayNote)note).Character);
         }
         else if (note is SpeedChangeNote)
         {
             if (((SpeedChangeNote)note).TurnOnFast)
             {
                 NoteTextBox.Text += "{";
             }
             else
             {
                 NoteTextBox.Text += "}";
             }
         }
         else if (note is Note)
         {
             NoteTextBox.Text += ((Note)note).Character;
         }
         else if (note is MultiNote)
         {
             NoteTextBox.Text += "[";
             foreach (Note multiNote in ((MultiNote)note).Notes)
             {
                 NoteTextBox.Text += multiNote.Character;
             }
             NoteTextBox.Text += "]";
         }
     }
 }
 /// <summary>
 ///     Reset window layout after completing and Purchase and get ready for adding new Purchase
 /// </summary>
 public void InitializeNewPurchase()
 {
     Purchase = new Purchase();
     TextBoxQty.Clear();
     TotalAmountTextBox.Clear();
     NoteTextBox.Clear();
     RefreshPurchaseEntriesDataGrid();
     SearchProductComboBox.Text = string.Empty;
     SupplierComboBox.Text      = string.Empty;
     PurchaseEntriesDataGrid.GetBindingExpression(ItemsControl.ItemsSourceProperty)?.UpdateTarget();
 }
Beispiel #3
0
        private void AddButton_Click(object sender, EventArgs e)
        {
            // Get the selected key in the combo box.
            string key = (string)KeysComboBox.SelectedValue;

            // Get the text entered by the user.
            string noteValue = NoteTextBox.Text;

            // Add the note text to the selected key.
            _theAccount.Notes.Add(key, noteValue);

            // Redisplay the notes.
            DisplayNotes();
            NoteTextBox.Clear();
            NoteTextBox.Focus();
        }