private void StartMonitoring() { if (IsWatcherRunning) { // Already running. return; } if (!IsPrintToDriveInstalled) { // Printer not installed. return; } if (!userSession.Settings.PrintToDrivePrompt && !IsUploadPathSet) { // Configured to upload to a default Drive path but it is not set. return; } // Create the folder watcher. printJobMonitor = new PrintToDriveMonitor(); #pragma warning disable 4014 printJobMonitor.Start(p => ProcessNewPrintJob(p), SynchronizationContext.Current); #pragma warning restore 4014 pictureStartedStopped.Image = Resources.started; labelMonitorStatus.Text = "Print to Drive monitor is running."; }
private void StartMonitoring() { if (IsWatcherRunning) { // Already running. return; } if (!IsPrinterInstalled || !IsMhwFaxInstalled) { // Printer or app not installed. return; } // Create the folder watcher. printJobMonitor = new PrintToFaxMonitor(); #pragma warning disable 4014 printJobMonitor.Start(p => ProcessNewPrintJob(p), SynchronizationContext.Current); #pragma warning restore 4014 pictureStartedStopped.Image = Resources.started; }
private static void Main() { Task.Run(() => JobMonitor.Start()); MainAsync().Wait(); }