Inheritance: IBatchGuyEAC3ToSettingsService
        private void HandlesSaveToolStripMenuItemClick()
        {
            SaveFileDialog sfd = new SaveFileDialog();
            sfd.Filter = "BatchGuy File|*.batchGuyEac3toSettings";
            sfd.Title = "Save eac3to Settings File";
            sfd.ShowDialog();

            if (!string.IsNullOrEmpty(sfd.FileName))
            {
                dgvFiles.CurrentCell = null; //force the cell change so cell changed event fires
                _batchGuyEAC3ToSettings.X264Files = this.GetX264Files();
                _batchGuyEAC3ToSettings.X264FileSettings = this.GetX264FileSettings();
                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);
                }
            }
        }
 private void HandlesLoadToolStripMenuItemClick(string settingsFile)
 {
     try
     {
         if (!string.IsNullOrEmpty(settingsFile))
         {
             IJsonSerializationService<BatchGuyEAC3ToSettings> jsonSerializationService = new JsonSerializationService<BatchGuyEAC3ToSettings>();
             IBatchGuyEAC3ToSettingsService batchGuyEAC3ToSettingsService = new BatchGuyEAC3ToSettingsService(jsonSerializationService);
             _batchGuyEAC3ToSettings = batchGuyEAC3ToSettingsService.GetBatchGuyEAC3ToSettings(settingsFile);
             if (batchGuyEAC3ToSettingsService.Errors.Count() > 0)
             {
                 MessageBox.Show(batchGuyEAC3ToSettingsService.Errors.GetErrorMessage(), "Error Occurred.", MessageBoxButtons.OK, MessageBoxIcon.Error);
             }
             else if (_batchGuyEAC3ToSettings.EAC3ToSettings.IsExtractForRemux)
             {
                 MessageBox.Show("You cannot load a (.batchGuyEac3toSettings) file that is for Remuxing!", "Error Occurred.", MessageBoxButtons.OK, MessageBoxIcon.Error);
             }
             else
             {
                 this._encodeTypeChangedBecauseOfSettingsLoad = true;
                 this.LoadEpisodeNumbers();
                 this.LoadScreen();
                 gbScreen.SetEnabled(true);
                 saveToolStripMenuItem.Enabled = true;
                 createX264BatchFileToolStripMenuItem.Enabled = true;
                 createMkvmergeBatchFileToolStripMenuItem.Enabled = true;
             }
         }
     }
     catch (Exception ex)
     {
         _displayErrorMessageService.DisplayError(new ErrorMessage() { DisplayMessage = "There was an error trying to load the eac3to Settings File!", DisplayTitle = "Error.", Exception = ex, MethodNameWhereExceptionOccurred = MethodBase.GetCurrentMethod().Name });
     }
 }
示例#3
0
        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);
                    }
                }
            }
        }
示例#4
0
 private void HandlesLoadToolStripMenuItemClick(string settingsFile)
 {
     try
     {
         if (!string.IsNullOrEmpty(settingsFile))
         {
             IJsonSerializationService<BatchGuyEAC3ToSettings> jsonSerializationService = new JsonSerializationService<BatchGuyEAC3ToSettings>();
             IBatchGuyEAC3ToSettingsService batchGuyEAC3ToSettingsService = new BatchGuyEAC3ToSettingsService(jsonSerializationService);
             _batchGuyEAC3ToSettings = batchGuyEAC3ToSettingsService.GetBatchGuyEAC3ToSettings(settingsFile);
             if (batchGuyEAC3ToSettingsService.Errors.Count() > 0)
             {
                 MessageBox.Show(batchGuyEAC3ToSettingsService.Errors.GetErrorMessage(), "Error Occurred.", MessageBoxButtons.OK, MessageBoxIcon.Error);
             }
             else
             {
                 this.ReloadEac3ToSettingsAndBluRayDiscs(_batchGuyEAC3ToSettings);
                 this.ReloadRemux();
                 this.SettxtRemuxSeasonNumberEnabledStatus();
             }
         }
     }
     catch (Exception ex)
     {
         _displayErrorMessageService.DisplayError(new ErrorMessage() { DisplayMessage = "There was an error trying to load the eac3to Settings File!", DisplayTitle = "Error.", Exception = ex, MethodNameWhereExceptionOccurred = MethodBase.GetCurrentMethod().Name });
     }
 }
        private void HandlessaveToolStripMenuItemClick()
        {
            SaveFileDialog sfd = new SaveFileDialog();
            sfd.Filter = "BatchGuy File|*.batchGuyEac3toSettings";
            sfd.Title = "Save eac3to Settings File";
            sfd.ShowDialog();

            if (!string.IsNullOrEmpty(sfd.FileName))
            {
                _batchGuyEAC3ToSettings.AVSBatchSettings = this.GetAVSBatchSettings();
                _batchGuyEAC3ToSettings.AVSScript = this.GetAVSScript();
                this.SetFFMSIndexSettings();
                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);
                }
            }
        }
 private void HandlesLoadToolStripMenuItemClick(string settingsFile)
 {
     if (!string.IsNullOrEmpty(settingsFile))
     {
         IJsonSerializationService<BatchGuyEAC3ToSettings> jsonSerializationService = new JsonSerializationService<BatchGuyEAC3ToSettings>();
         IBatchGuyEAC3ToSettingsService batchGuyEAC3ToSettingsService = new BatchGuyEAC3ToSettingsService(jsonSerializationService);
         _batchGuyEAC3ToSettings = batchGuyEAC3ToSettingsService.GetBatchGuyEAC3ToSettings(settingsFile);
         if (batchGuyEAC3ToSettingsService.Errors.Count() > 0)
         {
             MessageBox.Show(batchGuyEAC3ToSettingsService.Errors.GetErrorMessage(), "Error Occurred.", MessageBoxButtons.OK, MessageBoxIcon.Error);
         }
         else if (_batchGuyEAC3ToSettings.EAC3ToSettings.IsExtractForRemux)
         {
             MessageBox.Show("You cannot load a (.batchGuyEac3toSettings) file that is for Remuxing!", "Error Occurred.", MessageBoxButtons.OK, MessageBoxIcon.Error);
         }
         else
         {
             this.LoadScreen();
             gbScreen.SetEnabled(true);
             saveToolStripMenuItem.Enabled = true;
             createAviSynthavsFilesToolStripMenuItem.Enabled = true;
         }
     }
 }