public void Setup(string name, ShowProcessingOutput spo, ulong defaultBiggerThanSize, string defaultBiggerThanUnit)
 {
     this.gbxContainer.Text = name;
     this.nudBigger.Value = (spo.Shown == ShowProcessingOutput.When.BiggerThan) ? spo.BiggerThanThisShownSize : defaultBiggerThanSize;
     this.cbxBigger.SelectedItem = (spo.Shown == ShowProcessingOutput.When.BiggerThan) ? spo.BiggerThanThisShownUnit : defaultBiggerThanUnit;
     this.chkAutoclose.Checked = spo.AutocloseOnSuccess;
     switch (spo.Shown)
     {
         case ShowProcessingOutput.When.Always:
             this.rbAlways.Checked = true;
             break;
         case ShowProcessingOutput.When.BiggerThan:
             this.rbBigger.Checked = true;
             break;
         case ShowProcessingOutput.When.Never:
         default:
             this.rbNever.Checked = true;
             break;
     }
 }
Example #2
0
 protected Exception RunTool(MediaInfo newInfo, Tool tool, ShowProcessingOutput spo, string tempFilename, IWin32Window parentWindow, string finalFilename)
 {
     Exception result = null;
     try
     {
         bool gui;
         switch (spo.Shown)
         {
             case ShowProcessingOutput.When.Always:
                 gui = true;
                 break;
             case ShowProcessingOutput.When.BiggerThan:
                 gui = (Convert.ToUInt64((new FileInfo(this.FullFilename)).Length) >= spo.BiggerThanThisBytes) ? true : false;
                 break;
             case ShowProcessingOutput.When.Never:
             default:
                 gui = false;
                 break;
         }
         if (gui)
         {
             result = tool.RunGUI(parentWindow, spo.AutocloseOnSuccess).Error;
         }
         else
         {
             result = tool.Run().Error;
         }
         if (result == null)
         {
             MediaInfo updatedInfo = this.GetInfo(tempFilename);
             if (!updatedInfo.CheckUpdatedInfo(this.Info, newInfo))
             {
                 result = new UnableToSetNewMetadataException();
             }
             else
             {
                 if (MediaData.Properties.Settings.Default.DeleteToTrash)
                 {
                     MyIO.DeleteToTrash(this.FullFilename);
                 }
                 else
                 {
                     File.Delete(this.FullFilename);
                 }
                 File.Move(tempFilename, finalFilename);
                 this._info = updatedInfo;
             }
         }
     }
     catch (Exception x)
     {
         result = x;
     }
     return result;
 }
Example #3
0
 protected Exception RunTool(MediaInfo newInfo, Tool tool, ShowProcessingOutput spo, string tempFilename, IWin32Window parentWindow)
 {
     return this.RunTool(newInfo, tool, spo, tempFilename, parentWindow, this.FullFilename);
 }