private mainWindow_Closing ( object sender, System e ) : void | ||
sender | object | The source of the event. |
e | System | The |
return | void |
private void mainWindow_Closing( object sender, System.ComponentModel.CancelEventArgs e )
{
BatchPage batchPage = null;
if ( mainWindow.Content is BatchPage )
{
batchPage = mainWindow.Content as BatchPage;
}
else if ( mainWindow.Content is ScanningPage )
{
batchPage = ( mainWindow.Content as ScanningPage ).batchPage;
}
if ( batchPage != null && batchPage.rangerScanner != null)
{
batchPage.rangerScanner.ShutDown();
}
Application.Current.Shutdown();
}