protected void SwapUserControl(ucScreenBase fromUserControl, Type toUserControl)
        {
#if TRACE_BASE
            Common.WriteToDebugWindow(string.Format("{0}:{1}()", CONTROL_NAME, System.Reflection.MethodInfo.GetCurrentMethod().Name));
#endif
            fromUserControl.RemoveApplicationEventHandlers();
            fromUserControl.BeforeSwappingOut();

            ShowControl(toUserControl);
        }
        /// <summary>
        ///
        /// </summary>
        /// <param name="uc"></param>
        private void ShowControl(ucScreenBase uc)
        {
#if TRACE_BASE
            Common.WriteToDebugWindow(string.Format("{0}:{1}()", CONTROL_NAME, System.Reflection.MethodInfo.GetCurrentMethod().Name));
#endif
            // Clear the existing Controls from the base control
            Common.SwapScreenBaseControl.Controls.Clear();
            // and then add the new UserControl to display to the controls collection.
            Common.SwapScreenBaseControl.Controls.Add(uc);

            uc.Dock = DockStyle.Fill;

            // Wire up the Event Handlers
            uc.InitializeApplicationEventHandlers();
            // And indicate we have just swapped back in.
            uc.AfterSwappingIn();
        }
Beispiel #3
0
 public ScreenSwapEventArgs(User_Interface.ucScreenBase fromScreen, Type toScreenType)
 {
     FromScreen   = fromScreen;
     ToScreenType = toScreenType;
 }