private void HandlesSaveToolStripMenuItemClick()
{
this.SetEac3ToConfiguration();
this.SetEAC3ToRemuxFileNameTemplate();
if (this.IsAtLeastOneDiscLoaded() && this.IsScreenValid())
{
SaveFileDialog sfd = new SaveFileDialog();
sfd.Filter = "BatchGuy File|*.batchGuyEac3toSettings";
sfd.Title = "Save eac3to Settings File";
sfd.ShowDialog();
if (!string.IsNullOrEmpty(sfd.FileName))
{
dgvBluRayDiscInfo.CurrentCell = null; //force the cell change so cell changed event fires
dgvBluRaySummary.CurrentCell = null; //force the cell change so cell changed event fires
List<BluRayDiscInfo> discs = this.GetBluRayDiscInfoList();
if (_batchGuyEAC3ToSettings == null)
_batchGuyEAC3ToSettings = new BatchGuyEAC3ToSettings();
_batchGuyEAC3ToSettings.BluRayDiscs = discs;
_batchGuyEAC3ToSettings.EAC3ToSettings = _eac3toConfiguration;
IJsonSerializationService<BatchGuyEAC3ToSettings> jsonSerializationService = new JsonSerializationService<BatchGuyEAC3ToSettings>();
IBatchGuyEAC3ToSettingsService batchGuyEAC3ToSettingsService = new BatchGuyEAC3ToSettingsService(jsonSerializationService);
batchGuyEAC3ToSettingsService.Save(sfd.FileName, _batchGuyEAC3ToSettings);
if (batchGuyEAC3ToSettingsService.Errors.Count() > 0)
{
MessageBox.Show(batchGuyEAC3ToSettingsService.Errors.GetErrorMessage(), "Error Occurred.", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
}
}