periodic commit - still busted
This commit is contained in:
parent
e130b5f07f
commit
ebfbee526e
@ -7,7 +7,7 @@
|
|||||||
WindowStyle="None"
|
WindowStyle="None"
|
||||||
Background="Transparent"
|
Background="Transparent"
|
||||||
WindowStartupLocation="CenterScreen"
|
WindowStartupLocation="CenterScreen"
|
||||||
Topmost="True" ShowInTaskbar="False">
|
Topmost="True" ShowInTaskbar="True">
|
||||||
<Grid>
|
<Grid>
|
||||||
<Image Name="QuillPenBackground" Source="Adobe_CreatePDF_icon.PNG" HorizontalAlignment="Center" VerticalAlignment="Top" Height="200" Width="200" ></Image>
|
<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" />
|
<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" />
|
||||||
|
@ -19,11 +19,10 @@ namespace PdfScribe
|
|||||||
this.progressTimer.Enabled = false;
|
this.progressTimer.Enabled = false;
|
||||||
this.progressTimer.Interval = 250; // Quarter second is default
|
this.progressTimer.Interval = 250; // Quarter second is default
|
||||||
this.progressTimer.Elapsed += new SysTimers.ElapsedEventHandler(progressTimer_Elapsed);
|
this.progressTimer.Elapsed += new SysTimers.ElapsedEventHandler(progressTimer_Elapsed);
|
||||||
//this.activityWindow = new ActivityNotification();
|
this.activityWindow = new ActivityNotification();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private Application activityWindowApp;
|
|
||||||
private ActivityNotification activityWindow = null;
|
private ActivityNotification activityWindow = null;
|
||||||
private SysTimers.Timer progressTimer;
|
private SysTimers.Timer progressTimer;
|
||||||
private readonly String progressString = "CAPTURING";
|
private readonly String progressString = "CAPTURING";
|
||||||
@ -35,6 +34,12 @@ namespace PdfScribe
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public void ShowActivityNotificationWindow()
|
public void ShowActivityNotificationWindow()
|
||||||
{
|
{
|
||||||
|
if (this.activityWindow != null)
|
||||||
|
{
|
||||||
|
this.activityWindow.Show();
|
||||||
|
this.progressTimer.Start();
|
||||||
|
}
|
||||||
|
/*
|
||||||
if (this.activityWindow == null)
|
if (this.activityWindow == null)
|
||||||
{
|
{
|
||||||
|
|
||||||
@ -55,6 +60,7 @@ namespace PdfScribe
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -87,6 +93,7 @@ namespace PdfScribe
|
|||||||
this.progressTimer.Stop();
|
this.progressTimer.Stop();
|
||||||
if (this.activityWindow != null)
|
if (this.activityWindow != null)
|
||||||
{
|
{
|
||||||
|
/*
|
||||||
if (this.activityWindow.Dispatcher.CheckAccess())
|
if (this.activityWindow.Dispatcher.CheckAccess())
|
||||||
{
|
{
|
||||||
this.activityWindow.Close();
|
this.activityWindow.Close();
|
||||||
@ -98,7 +105,8 @@ namespace PdfScribe
|
|||||||
this.activityWindow.Close();
|
this.activityWindow.Close();
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
}
|
}*/
|
||||||
|
this.activityWindow.Close();
|
||||||
this.activityWindow = null;
|
this.activityWindow = null;
|
||||||
}
|
}
|
||||||
/*
|
/*
|
||||||
@ -133,7 +141,8 @@ namespace PdfScribe
|
|||||||
{
|
{
|
||||||
if (this.progressCounter >= progressString.Length)
|
if (this.progressCounter >= progressString.Length)
|
||||||
this.progressCounter = 0;
|
this.progressCounter = 0;
|
||||||
|
this.activityWindow.labelProgress.Content = this.progressString.Substring(0, progressCounter + 1);
|
||||||
|
/*
|
||||||
if (activityWindow.labelProgress.Dispatcher.CheckAccess())
|
if (activityWindow.labelProgress.Dispatcher.CheckAccess())
|
||||||
{
|
{
|
||||||
//EventLog.WriteEntry("PdfScribe", "Timer_No_Invoke");
|
//EventLog.WriteEntry("PdfScribe", "Timer_No_Invoke");
|
||||||
@ -149,6 +158,7 @@ namespace PdfScribe
|
|||||||
);
|
);
|
||||||
//EventLog.WriteEntry("PdfScribe", "Timer_Invoked");
|
//EventLog.WriteEntry("PdfScribe", "Timer_Invoked");
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
progressCounter++;
|
progressCounter++;
|
||||||
}
|
}
|
||||||
((SysTimers.Timer)sender).Start();
|
((SysTimers.Timer)sender).Start();
|
||||||
|
@ -40,7 +40,8 @@ namespace PdfScribe
|
|||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
static Application guiApplication = null;
|
static Application guiApplication = null;
|
||||||
static ActivityNotificationPresenter userDisplay;
|
static Dispatcher guiDispatcher = null;
|
||||||
|
static ActivityNotificationPresenter activityNotification = null;
|
||||||
static TraceSource logEventSource = new TraceSource(traceSourceName);
|
static TraceSource logEventSource = new TraceSource(traceSourceName);
|
||||||
|
|
||||||
[STAThread]
|
[STAThread]
|
||||||
@ -90,7 +91,8 @@ namespace PdfScribe
|
|||||||
errorDialogInstructionCouldNotWrite,
|
errorDialogInstructionCouldNotWrite,
|
||||||
String.Format("{0} is in use.", outputFilename));*/
|
String.Format("{0} is in use.", outputFilename));*/
|
||||||
|
|
||||||
DispatchToGUIApp((Action)delegate()
|
DispatchToGUIApp(
|
||||||
|
(Action)delegate()
|
||||||
{
|
{
|
||||||
ErrorDialogPresenter errorDialog = new ErrorDialogPresenter(errorDialogCaption,
|
ErrorDialogPresenter errorDialog = new ErrorDialogPresenter(errorDialogCaption,
|
||||||
errorDialogInstructionCouldNotWrite,
|
errorDialogInstructionCouldNotWrite,
|
||||||
@ -138,7 +140,7 @@ namespace PdfScribe
|
|||||||
(int)TraceEventType.Warning,
|
(int)TraceEventType.Warning,
|
||||||
String.Format(warnFileNotDeleted, standardInputFilename));
|
String.Format(warnFileNotDeleted, standardInputFilename));
|
||||||
}
|
}
|
||||||
ShutdownApplication();
|
//ShutdownApplication();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -165,12 +167,11 @@ namespace PdfScribe
|
|||||||
{
|
{
|
||||||
if (guiApplication != null)
|
if (guiApplication != null)
|
||||||
{
|
{
|
||||||
guiApplication.Dispatcher.Invoke((Action)delegate()
|
DispatchToGUIApp((Action)delegate()
|
||||||
{
|
{
|
||||||
//ActivityNotificationPresenter notificationPresenter = new ActivityNotificationPresenter();
|
ActivityNotificationPresenter notificationPresenter = new ActivityNotificationPresenter();
|
||||||
//notificationPresenter.ShowActivityNotificationWindow();
|
notificationPresenter.ShowActivityNotificationWindow();
|
||||||
ActivityNotification testWindow = new ActivityNotification();
|
System.Windows.Threading.Dispatcher.Run();
|
||||||
testWindow.Show();
|
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@ -185,6 +186,8 @@ namespace PdfScribe
|
|||||||
{
|
{
|
||||||
guiApplication = new Application();
|
guiApplication = new Application();
|
||||||
guiApplication.ShutdownMode = ShutdownMode.OnExplicitShutdown;
|
guiApplication.ShutdownMode = ShutdownMode.OnExplicitShutdown;
|
||||||
|
activityNotification = new ActivityNotificationPresenter();
|
||||||
|
activityNotification.ShowActivityNotificationWindow();
|
||||||
guiApplication.Run();
|
guiApplication.Run();
|
||||||
}
|
}
|
||||||
));
|
));
|
||||||
@ -197,15 +200,32 @@ namespace PdfScribe
|
|||||||
static void DispatchToGUIApp(Action guiAction)
|
static void DispatchToGUIApp(Action guiAction)
|
||||||
{
|
{
|
||||||
if (guiApplication != null)
|
if (guiApplication != null)
|
||||||
|
{
|
||||||
|
if (guiApplication.Dispatcher.Thread != System.Windows.Threading.Dispatcher.CurrentDispatcher.Thread)
|
||||||
{
|
{
|
||||||
guiApplication.Dispatcher.Invoke(guiAction);
|
guiApplication.Dispatcher.Invoke(guiAction);
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
guiAction.Invoke();
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void ShutdownApplication()
|
static void ShutdownApplication()
|
||||||
{
|
{
|
||||||
if (guiApplication != null)
|
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()
|
guiApplication.Dispatcher.Invoke((Action)delegate()
|
||||||
{
|
{
|
||||||
if (guiApplication.Windows != null && guiApplication.Windows.Count > 0)
|
if (guiApplication.Windows != null && guiApplication.Windows.Count > 0)
|
||||||
@ -220,7 +240,7 @@ namespace PdfScribe
|
|||||||
|
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
*/
|
||||||
//guiApplication.Dispatcher.BeginInvokeShutdown(System.Windows.Threading.DispatcherPriority.Send);
|
//guiApplication.Dispatcher.BeginInvokeShutdown(System.Windows.Threading.DispatcherPriority.Send);
|
||||||
//guiApplication.Shutdown();
|
//guiApplication.Shutdown();
|
||||||
//guiApplication = null;
|
//guiApplication = null;
|
||||||
|
@ -53,6 +53,7 @@ namespace PdfScribeCore
|
|||||||
simpleTaskDialog.Opened += new EventHandler(simpleTaskDialog_Opened);
|
simpleTaskDialog.Opened += new EventHandler(simpleTaskDialog_Opened);
|
||||||
simpleTaskDialog.StartupLocation = APICodePack.TaskDialogStartupLocation.CenterScreen;
|
simpleTaskDialog.StartupLocation = APICodePack.TaskDialogStartupLocation.CenterScreen;
|
||||||
simpleTaskDialog.Show();
|
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
|
// someone else fixes first - also why isn't the API Code pack on codeplex
|
||||||
// or github so people can push patches), but until then...
|
// or github so people can push patches), but until then...
|
||||||
((APICodePack.TaskDialog)sender).Icon = this.DefaultTaskIcon;
|
((APICodePack.TaskDialog)sender).Icon = this.DefaultTaskIcon;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user