From f8f990d84e47bd982b9e8a82b3ed4f8e9268fb4a Mon Sep 17 00:00:00 2001 From: S T Chan Date: Sat, 11 Jan 2014 19:14:56 -0500 Subject: [PATCH] Removed ActivityNotification.xaml, updated app.config to allow tracing --- PdfScribe/ActivityNotification.xaml | 15 -- PdfScribe/ActivityNotification.xaml.cs | 26 ---- PdfScribe/ActivityNotificationPresenter.cs | 168 --------------------- PdfScribe/App.config | 24 ++- PdfScribe/PdfScribe.csproj | 4 +- PdfScribe/Program.cs | 1 + PdfScribe/app.manifest | 4 +- PdfScribeCore/PdfScribeCore.csproj | 2 - PdfScribeCore/PdfScribeInstaller.cs | 1 - PdfScribeInstall/Product.wxs | 3 + 10 files changed, 32 insertions(+), 216 deletions(-) delete mode 100644 PdfScribe/ActivityNotification.xaml delete mode 100644 PdfScribe/ActivityNotification.xaml.cs delete mode 100644 PdfScribe/ActivityNotificationPresenter.cs diff --git a/PdfScribe/ActivityNotification.xaml b/PdfScribe/ActivityNotification.xaml deleted file mode 100644 index 7ab1fe5..0000000 --- a/PdfScribe/ActivityNotification.xaml +++ /dev/null @@ -1,15 +0,0 @@ - - - - - diff --git a/PdfScribe/ActivityNotification.xaml.cs b/PdfScribe/ActivityNotification.xaml.cs deleted file mode 100644 index 56ce1ee..0000000 --- a/PdfScribe/ActivityNotification.xaml.cs +++ /dev/null @@ -1,26 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Windows; -using System.Windows.Controls; -using System.Windows.Data; -using System.Windows.Documents; -using System.Windows.Input; -using System.Windows.Media; -using System.Windows.Media.Imaging; -using System.Windows.Shapes; - -namespace PdfScribe -{ - /// - /// Interaction logic for ActivityNotification.xaml - /// - internal partial class ActivityNotification : Window - { - internal ActivityNotification() - { - InitializeComponent(); - } - } -} diff --git a/PdfScribe/ActivityNotificationPresenter.cs b/PdfScribe/ActivityNotificationPresenter.cs deleted file mode 100644 index c7d89a7..0000000 --- a/PdfScribe/ActivityNotificationPresenter.cs +++ /dev/null @@ -1,168 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Diagnostics; -using System.Linq; -using System.Text; -using System.Threading; -using SysTimers = System.Timers; -using System.Windows; - - -namespace PdfScribe -{ - public class ActivityNotificationPresenter - { - - public ActivityNotificationPresenter() - { - this.progressTimer = new SysTimers.Timer(); - this.progressTimer.Enabled = false; - this.progressTimer.Interval = 250; // Quarter second is default - this.progressTimer.Elapsed += new SysTimers.ElapsedEventHandler(progressTimer_Elapsed); - this.activityWindow = new ActivityNotification(); - } - - - private ActivityNotification activityWindow = null; - private SysTimers.Timer progressTimer; - private readonly String progressString = "CAPTURING"; - - /// - /// Displays the floating frameless - /// activity notification window on - /// a separate thread - /// - public void ShowActivityNotificationWindow() - { - if (this.activityWindow != null) - { - this.activityWindow.Show(); - this.progressTimer.Start(); - } - /* - if (this.activityWindow == null) - { - - if (this.activityWindow.Dispatcher.CheckAccess()) - { - this.activityWindow = new ActivityNotification(); - this.activityWindow.Show(); - this.progressTimer.Start(); - } - else - { - this.activityWindow.Dispatcher.Invoke((Action)delegate() - { - this.activityWindow = new ActivityNotification(); - this.activityWindow.Show(); - this.progressTimer.Start(); - } - ); - } - } - */ - } - - /* - public void ShowActivityNotificationWindow() - { - if (this.activityWindowApp == null) - { - activityWindowApp = new Application(); - var activityWindowThread = new Thread(new ThreadStart(() => - { - activityWindow = new ActivityNotification(); - activityWindowApp.ShutdownMode = ShutdownMode.OnExplicitShutdown; - activityWindowApp.Run(activityWindow); - } - )); - activityWindowThread.SetApartmentState(ApartmentState.STA); - activityWindowThread.Start(); - this.progressTimer.Enabled = true; - } - } - */ - - /// - /// Shuts down the WPF Application showing - /// the ActivityNotification window - /// - public void CloseActivityNotificationWindow() - { - //this.progressTimer.Elapsed -= new SysTimers.ElapsedEventHandler(progressTimer_Elapsed); - this.progressTimer.Stop(); - if (this.activityWindow != null) - { - /* - if (this.activityWindow.Dispatcher.CheckAccess()) - { - this.activityWindow.Close(); - } - else - { - this.activityWindow.Dispatcher.Invoke((Action)delegate() - { - this.activityWindow.Close(); - } - ); - }*/ - this.activityWindow.Close(); - this.activityWindow = null; - } - /* - if (activityWindowApp != null) - { - this.progressTimer.Stop(); - // Close windows rather than - // just bashing the WPF application - activityWindowApp.Dispatcher.Invoke((Action)delegate() - { - foreach (Window appWindow in activityWindowApp.Windows) - { - appWindow.Close(); - } - } - ); - activityWindowApp.Dispatcher.InvokeShutdown(); - activityWindowApp = null; - this.progressTimer.Dispose(); - this.progressTimer = null; - } - */ - } - - - private int progressCounter = 0; - static Object timerElapsedLock = new Object(); - private void progressTimer_Elapsed(object sender, SysTimers.ElapsedEventArgs e) - { - ((SysTimers.Timer)sender).Stop(); - if (activityWindow != null) - { - if (this.progressCounter >= progressString.Length) - this.progressCounter = 0; - this.activityWindow.labelProgress.Content = this.progressString.Substring(0, progressCounter + 1); - /* - if (activityWindow.labelProgress.Dispatcher.CheckAccess()) - { - //EventLog.WriteEntry("PdfScribe", "Timer_No_Invoke"); - this.activityWindow.labelProgress.Content = this.progressString.Substring(0, progressCounter + 1); - } - else - { - //EventLog.WriteEntry("PdfScribe", "Timer_Invoke"); - this.activityWindow.labelProgress.Dispatcher.Invoke((Action)delegate() - { - this.activityWindow.labelProgress.Content = this.progressString.Substring(0, progressCounter + 1); - } - ); - //EventLog.WriteEntry("PdfScribe", "Timer_Invoked"); - } - */ - progressCounter++; - } - ((SysTimers.Timer)sender).Start(); - } - - } -} diff --git a/PdfScribe/App.config b/PdfScribe/App.config index e2b607f..0130299 100644 --- a/PdfScribe/App.config +++ b/PdfScribe/App.config @@ -1,3 +1,25 @@  - + + + + + + + + + + + + + + + + + + + diff --git a/PdfScribe/PdfScribe.csproj b/PdfScribe/PdfScribe.csproj index dc0a285..ecaa00f 100644 --- a/PdfScribe/PdfScribe.csproj +++ b/PdfScribe/PdfScribe.csproj @@ -115,7 +115,9 @@ ResXFileCodeGenerator Resources.Designer.cs - + + Designer + SettingsSingleFileGenerator diff --git a/PdfScribe/Program.cs b/PdfScribe/Program.cs index 74c9a05..d9bae51 100644 --- a/PdfScribe/Program.cs +++ b/PdfScribe/Program.cs @@ -123,6 +123,7 @@ namespace PdfScribe (int)TraceEventType.Warning, String.Format(warnFileNotDeleted, standardInputFilename)); } + logEventSource.Flush(); } } diff --git a/PdfScribe/app.manifest b/PdfScribe/app.manifest index 50724ed..4212d80 100644 --- a/PdfScribe/app.manifest +++ b/PdfScribe/app.manifest @@ -32,7 +32,7 @@ - + diff --git a/PdfScribeCore/PdfScribeCore.csproj b/PdfScribeCore/PdfScribeCore.csproj index 55189ef..b3fed1d 100644 --- a/PdfScribeCore/PdfScribeCore.csproj +++ b/PdfScribeCore/PdfScribeCore.csproj @@ -101,8 +101,6 @@ PdfScribeSharedAssemblyInfo.cs - - diff --git a/PdfScribeCore/PdfScribeInstaller.cs b/PdfScribeCore/PdfScribeInstaller.cs index e175798..7c299b8 100644 --- a/PdfScribeCore/PdfScribeInstaller.cs +++ b/PdfScribeCore/PdfScribeInstaller.cs @@ -624,7 +624,6 @@ namespace PdfScribeCore public bool UninstallPdfScribePrinter() { bool printerUninstalledCleanly = true; - ErrorDialogPresenter test = new ErrorDialogPresenter(); if (!DeletePdfScribePrinter()) printerUninstalledCleanly = false; diff --git a/PdfScribeInstall/Product.wxs b/PdfScribeInstall/Product.wxs index 1a73698..cc7cffe 100644 --- a/PdfScribeInstall/Product.wxs +++ b/PdfScribeInstall/Product.wxs @@ -9,6 +9,9 @@ + + +