periodic commit - still busted

This commit is contained in:
S T Chan 2014-01-10 09:59:01 -05:00
parent e130b5f07f
commit ebfbee526e
4 changed files with 54 additions and 22 deletions

View File

@ -7,7 +7,7 @@
WindowStyle="None"
Background="Transparent"
WindowStartupLocation="CenterScreen"
Topmost="True" ShowInTaskbar="False">
Topmost="True" ShowInTaskbar="True">
<Grid>
<Image Name="QuillPenBackground" Source="Adobe_CreatePDF_icon.PNG" HorizontalAlignment="Center" VerticalAlignment="Top" Height="200" Width="200" ></Image>
<Label Height="29" HorizontalAlignment="Left" Margin="12,203,0,0" Name="labelProgress" VerticalAlignment="Top" Width="254" Foreground="Red" FontFamily="Arial Rounded MT" FontSize="16" HorizontalContentAlignment="Center" FontWeight="Bold" VerticalContentAlignment="Top" Content="CAPTURING" />

View File

@ -19,11 +19,10 @@ namespace PdfScribe
this.progressTimer.Enabled = false;
this.progressTimer.Interval = 250; // Quarter second is default
this.progressTimer.Elapsed += new SysTimers.ElapsedEventHandler(progressTimer_Elapsed);
//this.activityWindow = new ActivityNotification();
this.activityWindow = new ActivityNotification();
}
private Application activityWindowApp;
private ActivityNotification activityWindow = null;
private SysTimers.Timer progressTimer;
private readonly String progressString = "CAPTURING";
@ -35,6 +34,12 @@ namespace PdfScribe
/// </summary>
public void ShowActivityNotificationWindow()
{
if (this.activityWindow != null)
{
this.activityWindow.Show();
this.progressTimer.Start();
}
/*
if (this.activityWindow == null)
{
@ -55,6 +60,7 @@ namespace PdfScribe
);
}
}
*/
}
/*
@ -87,6 +93,7 @@ namespace PdfScribe
this.progressTimer.Stop();
if (this.activityWindow != null)
{
/*
if (this.activityWindow.Dispatcher.CheckAccess())
{
this.activityWindow.Close();
@ -98,7 +105,8 @@ namespace PdfScribe
this.activityWindow.Close();
}
);
}
}*/
this.activityWindow.Close();
this.activityWindow = null;
}
/*
@ -133,7 +141,8 @@ namespace PdfScribe
{
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");
@ -149,6 +158,7 @@ namespace PdfScribe
);
//EventLog.WriteEntry("PdfScribe", "Timer_Invoked");
}
*/
progressCounter++;
}
((SysTimers.Timer)sender).Start();

View File

@ -39,8 +39,9 @@ namespace PdfScribe
#endregion
static Application guiApplication = null;
static ActivityNotificationPresenter userDisplay;
static Application guiApplication = null;
static Dispatcher guiDispatcher = null;
static ActivityNotificationPresenter activityNotification = null;
static TraceSource logEventSource = new TraceSource(traceSourceName);
[STAThread]
@ -90,13 +91,14 @@ namespace PdfScribe
errorDialogInstructionCouldNotWrite,
String.Format("{0} is in use.", outputFilename));*/
DispatchToGUIApp((Action)delegate()
{
ErrorDialogPresenter errorDialog = new ErrorDialogPresenter(errorDialogCaption,
errorDialogInstructionCouldNotWrite,
String.Format("{0} is in use.", outputFilename));
}
);
DispatchToGUIApp(
(Action)delegate()
{
ErrorDialogPresenter errorDialog = new ErrorDialogPresenter(errorDialogCaption,
errorDialogInstructionCouldNotWrite,
String.Format("{0} is in use.", outputFilename));
}
);
}
catch (UnauthorizedAccessException unauthorizedEx)
{
@ -138,7 +140,7 @@ namespace PdfScribe
(int)TraceEventType.Warning,
String.Format(warnFileNotDeleted, standardInputFilename));
}
ShutdownApplication();
//ShutdownApplication();
}
}
@ -165,12 +167,11 @@ namespace PdfScribe
{
if (guiApplication != null)
{
guiApplication.Dispatcher.Invoke((Action)delegate()
DispatchToGUIApp((Action)delegate()
{
//ActivityNotificationPresenter notificationPresenter = new ActivityNotificationPresenter();
//notificationPresenter.ShowActivityNotificationWindow();
ActivityNotification testWindow = new ActivityNotification();
testWindow.Show();
ActivityNotificationPresenter notificationPresenter = new ActivityNotificationPresenter();
notificationPresenter.ShowActivityNotificationWindow();
System.Windows.Threading.Dispatcher.Run();
}
);
}
@ -185,6 +186,8 @@ namespace PdfScribe
{
guiApplication = new Application();
guiApplication.ShutdownMode = ShutdownMode.OnExplicitShutdown;
activityNotification = new ActivityNotificationPresenter();
activityNotification.ShowActivityNotificationWindow();
guiApplication.Run();
}
));
@ -198,7 +201,14 @@ namespace PdfScribe
{
if (guiApplication != null)
{
guiApplication.Dispatcher.Invoke(guiAction);
if (guiApplication.Dispatcher.Thread != System.Windows.Threading.Dispatcher.CurrentDispatcher.Thread)
{
guiApplication.Dispatcher.Invoke(guiAction);
}
else
{
guiAction.Invoke();
}
}
}
@ -206,6 +216,16 @@ namespace PdfScribe
{
if (guiApplication != null)
{
if (guiApplication.Windows != null && guiApplication.Windows.Count > 0)
{
foreach (Window appWindow in guiApplication.Windows)
{
appWindow.Close();
}
}
guiApplication.Shutdown();
guiApplication = null;
/*
guiApplication.Dispatcher.Invoke((Action)delegate()
{
if (guiApplication.Windows != null && guiApplication.Windows.Count > 0)
@ -220,7 +240,7 @@ namespace PdfScribe
}
);
*/
//guiApplication.Dispatcher.BeginInvokeShutdown(System.Windows.Threading.DispatcherPriority.Send);
//guiApplication.Shutdown();
//guiApplication = null;

View File

@ -53,6 +53,7 @@ namespace PdfScribeCore
simpleTaskDialog.Opened += new EventHandler(simpleTaskDialog_Opened);
simpleTaskDialog.StartupLocation = APICodePack.TaskDialogStartupLocation.CenterScreen;
simpleTaskDialog.Show();
//System.Windows.Threading.Dispatcher.Run();
}
}
@ -67,6 +68,7 @@ namespace PdfScribeCore
// someone else fixes first - also why isn't the API Code pack on codeplex
// or github so people can push patches), but until then...
((APICodePack.TaskDialog)sender).Icon = this.DefaultTaskIcon;
}
}