Changeset 1065 for Scheduling/trunk/cs


Ignore:
Timestamp:
Jan 16, 2011, 5:32:40 AM (14 years ago)
Author:
Sam Habiel
Message:

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.

Location:
Scheduling/trunk/cs/bsdx0200GUISourceCode
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • Scheduling/trunk/cs/bsdx0200GUISourceCode/CGDocument.cs

    r1062 r1065  
    273273                         * TEST EXCEPTION -- REMOVE AFTER TESTING
    274274                         */
    275                         //throw new Exception("Simulated Uncaught Exception");
     275            // throw new Exception("Simulated Uncaught Exception");
    276276                        /*
    277277                         * TEST EXCEPTION -- REMOVE AFTER TESTING
     
    398398                }
    399399
     400        /// <summary>
     401        /// Refreshes Availablility and Schedules from RPMS.
     402        /// </summary>
     403        /// <returns>Success or Failure. Should be always Success.</returns>
    400404                private bool RefreshSchedule()
    401405                {
     
    586590                        //TODO:  Test that resource is not currently in list, that it IS a resource, etc
    587591                        this.m_sResourcesArray.Add(sResource);
     592            //UpdateAllViews: Redraws all the open views. But does not call server.
    588593                        this.UpdateAllViews();
    589594                }
  • Scheduling/trunk/cs/bsdx0200GUISourceCode/CGDocumentManager.cs

    r1062 r1065  
    173173            AttachConsole(ATTACH_PARENT_PROCESS);
    174174#endif
     175
     176#if TRACE
     177            DateTime startLoadTime = DateTime.Now;
     178#endif
     179
    175180            //Store a class instance of manager. Actual constructor does nothing.
    176181            _current = new CGDocumentManager();
     
    197202            doc.OnNewDocument();
    198203            Application.DoEvents();
     204#if TRACE
     205            DateTime EndLoadTime = DateTime.Now;
     206            TimeSpan LoadTime = EndLoadTime - startLoadTime;
     207            Debug.Write("Load Time for GUI is " + LoadTime.Seconds + " s & " + LoadTime.Milliseconds + " ms\n");
     208#endif
     209            //Application wide error handler for unhandled errors
     210            Application.ThreadException += new ThreadExceptionEventHandler(App_ThreadException);
    199211
    200212            //Run the application
     213            //Sam's Note: This is an unusual way to call this. Typically, it's run with
     214            //the main form as an argument.
    201215            Application.Run();
     216        }
     217
     218        /// <summary>
     219        /// Exception handler for application errors. TODO: Test
     220        /// </summary>
     221        /// <param name="sender"></param>
     222        /// <param name="e"></param>
     223        static void App_ThreadException(object sender, ThreadExceptionEventArgs e)
     224        {
     225            if (e.Exception is System.Net.Sockets.SocketException)
     226            {
     227                MessageBox.Show("Looks like we lost our connection with the server\nClick OK to terminate the application.");
     228                Application.Exit();
     229            }
     230
     231            string msg = "A problem has occured in this applicaton. \r\n\r\n" +
     232                "\t" + e.Exception.Message + "\r\n\r\n" +
     233                "Would you like to continue the application?";
     234
     235            DialogResult res = MessageBox.Show(msg, "Unexpected Error", MessageBoxButtons.YesNo);
     236
     237            if (res == DialogResult.Yes) return;
     238            else Application.Exit();
    202239        }
    203240
  • Scheduling/trunk/cs/bsdx0200GUISourceCode/CalendarGrid.cs

    r1038 r1065  
    8888            this.m_sfHour.Alignment = StringAlignment.Far;
    8989            this.m_bInitialUpdate = false;
     90            this.MouseEnter += new EventHandler(CalendarGrid_MouseEnter);
     91        }
     92
     93        void CalendarGrid_MouseEnter(object sender, EventArgs e)
     94        {
     95            this.Focus();
    9096        }
    9197
  • Scheduling/trunk/cs/bsdx0200GUISourceCode/ClinicalScheduling.csproj

    r1050 r1065  
    3535    </SccProvider>
    3636    <OldToolsVersion>3.5</OldToolsVersion>
    37     <TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
     37    <TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
    3838    <IsWebBootstrapper>false</IsWebBootstrapper>
    3939    <ManifestCertificateThumbprint>3202DD11CA9F64F7E52CF7BBED5F17D6E8A1B395</ManifestCertificateThumbprint>
  • Scheduling/trunk/cs/bsdx0200GUISourceCode/ClinicalScheduling.sln

    r1049 r1065  
    1717                {DE8E4CC9-4F3A-4E32-8DFE-EE5692E8FC45}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
    1818                {DE8E4CC9-4F3A-4E32-8DFE-EE5692E8FC45}.Debug|Any CPU.Build.0 = Debug|Any CPU
    19                 {DE8E4CC9-4F3A-4E32-8DFE-EE5692E8FC45}.Release|Any CPU.ActiveCfg = Debug|Any CPU
    20                 {DE8E4CC9-4F3A-4E32-8DFE-EE5692E8FC45}.Release|Any CPU.Build.0 = Debug|Any CPU
     19                {DE8E4CC9-4F3A-4E32-8DFE-EE5692E8FC45}.Release|Any CPU.ActiveCfg = Release|Any CPU
     20                {DE8E4CC9-4F3A-4E32-8DFE-EE5692E8FC45}.Release|Any CPU.Build.0 = Release|Any CPU
    2121        EndGlobalSection
    2222        GlobalSection(SolutionProperties) = preSolution
Note: See TracChangeset for help on using the changeset viewer.