CalendarGrid: Add MouseEnter event: puts focus on calendar grid. Used to "steal" focus from other controls so that lose focus events would fire.

CGDocumentManager: Added application-wide error handler on Application error exception; Added load timer to test how long it takes to load the GUI.
CGDocument: Just documentation updates.
This commit is contained in:
sam 2011-01-16 10:32:40 +00:00
parent 2b5c7ae0d7
commit c2fca2e1c6
8 changed files with 52 additions and 4 deletions

View File

@ -272,7 +272,7 @@ namespace IndianHealthService.ClinicalScheduling
/*
* TEST EXCEPTION -- REMOVE AFTER TESTING
*/
//throw new Exception("Simulated Uncaught Exception");
// throw new Exception("Simulated Uncaught Exception");
/*
* TEST EXCEPTION -- REMOVE AFTER TESTING
*/
@ -397,6 +397,10 @@ namespace IndianHealthService.ClinicalScheduling
}
}
/// <summary>
/// Refreshes Availablility and Schedules from RPMS.
/// </summary>
/// <returns>Success or Failure. Should be always Success.</returns>
private bool RefreshSchedule()
{
try
@ -585,6 +589,7 @@ namespace IndianHealthService.ClinicalScheduling
{
//TODO: Test that resource is not currently in list, that it IS a resource, etc
this.m_sResourcesArray.Add(sResource);
//UpdateAllViews: Redraws all the open views. But does not call server.
this.UpdateAllViews();
}

View File

@ -172,6 +172,11 @@ namespace IndianHealthService.ClinicalScheduling
// Note: Imported From kernel32.dll
AttachConsole(ATTACH_PARENT_PROCESS);
#endif
#if TRACE
DateTime startLoadTime = DateTime.Now;
#endif
//Store a class instance of manager. Actual constructor does nothing.
_current = new CGDocumentManager();
@ -196,11 +201,43 @@ namespace IndianHealthService.ClinicalScheduling
doc.DocManager = _current;
doc.OnNewDocument();
Application.DoEvents();
#if TRACE
DateTime EndLoadTime = DateTime.Now;
TimeSpan LoadTime = EndLoadTime - startLoadTime;
Debug.Write("Load Time for GUI is " + LoadTime.Seconds + " s & " + LoadTime.Milliseconds + " ms\n");
#endif
//Application wide error handler for unhandled errors
Application.ThreadException += new ThreadExceptionEventHandler(App_ThreadException);
//Run the application
//Sam's Note: This is an unusual way to call this. Typically, it's run with
//the main form as an argument.
Application.Run();
}
/// <summary>
/// Exception handler for application errors. TODO: Test
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
static void App_ThreadException(object sender, ThreadExceptionEventArgs e)
{
if (e.Exception is System.Net.Sockets.SocketException)
{
MessageBox.Show("Looks like we lost our connection with the server\nClick OK to terminate the application.");
Application.Exit();
}
string msg = "A problem has occured in this applicaton. \r\n\r\n" +
"\t" + e.Exception.Message + "\r\n\r\n" +
"Would you like to continue the application?";
DialogResult res = MessageBox.Show(msg, "Unexpected Error", MessageBoxButtons.YesNo);
if (res == DialogResult.Yes) return;
else Application.Exit();
}
#region BMXNet Event Handler
private void CDocMgrEventHandler(Object obj, BMXNet.BMXNetEventArgs e)

View File

@ -87,6 +87,12 @@
this.m_sfHour.LineAlignment = StringAlignment.Center;
this.m_sfHour.Alignment = StringAlignment.Far;
this.m_bInitialUpdate = false;
this.MouseEnter += new EventHandler(CalendarGrid_MouseEnter);
}
void CalendarGrid_MouseEnter(object sender, EventArgs e)
{
this.Focus();
}
private Rectangle AdjustRectForOverlap()

View File

@ -34,7 +34,7 @@
<SccProvider>
</SccProvider>
<OldToolsVersion>3.5</OldToolsVersion>
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<IsWebBootstrapper>false</IsWebBootstrapper>
<ManifestCertificateThumbprint>3202DD11CA9F64F7E52CF7BBED5F17D6E8A1B395</ManifestCertificateThumbprint>
<ManifestKeyFile>ClinicalScheduling_TemporaryKey.pfx</ManifestKeyFile>

View File

@ -16,8 +16,8 @@ Global
{8C05C4F7-FE81-479F-87A0-44E04C7F6E0F}.Release|Any CPU.Build.0 = Debug|Any CPU
{DE8E4CC9-4F3A-4E32-8DFE-EE5692E8FC45}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{DE8E4CC9-4F3A-4E32-8DFE-EE5692E8FC45}.Debug|Any CPU.Build.0 = Debug|Any CPU
{DE8E4CC9-4F3A-4E32-8DFE-EE5692E8FC45}.Release|Any CPU.ActiveCfg = Debug|Any CPU
{DE8E4CC9-4F3A-4E32-8DFE-EE5692E8FC45}.Release|Any CPU.Build.0 = Debug|Any CPU
{DE8E4CC9-4F3A-4E32-8DFE-EE5692E8FC45}.Release|Any CPU.ActiveCfg = Release|Any CPU
{DE8E4CC9-4F3A-4E32-8DFE-EE5692E8FC45}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE