/// <summary>
 /// Save a modified or new recording format.  A new recording format is recognized by a Guid.Empty ID.
 /// </summary>
 /// <param name="recordingFileFormat">The recording format to save.</param>
 public async Task SaveRecordingFileFormat(RecordingFileFormat recordingFileFormat)
 {
     var request = NewRequest(HttpMethod.Post, "SaveRecordingFileFormat");
     request.AddBody(recordingFileFormat);
     await ExecuteAsync(request).ConfigureAwait(false);
 }
 private void _createNewButton_Click(object sender, EventArgs e)
 {
     RecordingFileFormat format = new RecordingFileFormat();
     format.Name = _defaultName;
     format.Format = RecordingFileFormat.DefaultFormat;
     _formatsBindingSource.Add(format);
     _formatsDataGridView.CurrentCell = _formatsDataGridView.Rows[_formatsDataGridView.Rows.Count - 1].Cells[0];
 }
 public override void OnCancel()
 {
     _displayedFormat = null;
     _formatsBindingSource.RemoveSort();
     base.OnCancel();
 }
 private void _deleteButton_Click(object sender, EventArgs e)
 {
     RecordingFileFormat format = GetSelectedFormat();
     if (format != null)
     {
         _displayedFormat = null;
         _recordingFormats.Remove(format);
         _deletedFormats.Add(format);
     }
 }
 private void UpdateSelectedFormat()
 {
     RecordingFileFormat selectedFormat = GetSelectedFormat();
     _deleteButton.Enabled = (selectedFormat != null);
     _nameTextBox.Enabled = (selectedFormat != null);
     _formatTextBox.Enabled = (selectedFormat != null);
     _exampleTextBox.Enabled = (selectedFormat != null);
     _resetCurrentToDefaultButton.Enabled = (selectedFormat != null);
     if (selectedFormat == null)
     {
         _nameTextBox.Text = String.Empty;
         _formatTextBox.Text = String.Empty;
         _exampleTextBox.Text = String.Empty;
     }
     else
     {
         _nameTextBox.Text = selectedFormat.Name;
         _formatTextBox.Text = selectedFormat.Format;
         _nameTextBox.Focus();
     }
     _displayedFormat = selectedFormat;
 }