Ejemplo n.º 1
0
 public static void PreProcess()
 {
     if ((MainReference.DataGridReference.AreAllCellsSelected(true)) && (!DataGrid.SelectionLessThanOrEqual(10, MainReference.DataGridReference)))
     {
         MessageBoxes.TooManyFilesSelected("File Open Error");
     }
     else if (!DataGrid.SelectionLessThanOrEqual(10, MainReference.DataGridReference))
     {
         MessageBoxes.TooManyFilesSelected("File Open Error");
     }
     else
     {
         IEnumerator <IDrawing> list = DataGrid.GetSelectedDrawings(MainReference.DataGridReference);
         while (list.MoveNext())
         {
             Thread.Sleep(500);
             Log.Write.Info($"eDrawingInstall - {EDrawingsInstall}");
             if (MainReference.EDrawingsDefaultMainToolStipMenuReference.Checked)
             {
                 try
                 {
                     Log.Write.Info($"Opening files using eDrawing install location.");
                     Process.Start(EDrawingsInstall, list.Current.Path);
                 }
                 catch (System.ComponentModel.Win32Exception)
                 {
                     Log.Write.Info($"Using OS to open files. eDrawing install threw exception. {EDrawingsInstall}");
                     Process.Start(list.Current.Path);
                 }
                 catch (System.InvalidOperationException)
                 {
                     Log.Write.Info($"Using OS to open files. eDrawing install threw exception. {EDrawingsInstall}");
                     Process.Start(list.Current.Path);
                 }
             }
             else
             {
                 Log.Write.Info($"Opening files using OS");
                 Process.Start(list.Current.Path);
             }
             StatusBar.UpdateMain($"File opened: {list.Current.File}");
             Log.Write.Info($"File opened: {list.Current.Path}");
         }
     }
 }
Ejemplo n.º 2
0
 public static void PreProcess()
 {
     // If printing is in process, skip the printing processes from spawning again.
     if (!IsPrinting)
     {
         if ((MainReference.DataGridReference.AreAllCellsSelected(true)) && (!DataGrid.SelectionLessThanOrEqual(10, MainReference.DataGridReference)))
         {
             MessageBoxes.TooManyFilesSelected("Print Error");
         }
         else if (!DataGrid.SelectionLessThanOrEqual(10, MainReference.DataGridReference))
         {
             MessageBoxes.TooManyFilesSelected("Print Error");
         }
         else
         {
             IsPrinting = true;
             FilePrint.Process(DataGrid.GetSelectedDrawings(MainReference.DataGridReference), DataGrid.CountOfSelection(MainReference.DataGridReference));
         }
     }
 }