예제 #1
0
 void uiDriver_PageUnLoading(BasePage page)
 {
     ClearTray();
 }
예제 #2
0
 void uiDriver_PageLoaded(BasePage page)
 {
     txtPageName.Text = page.Title;
 }
예제 #3
0
 void uiDriver_PageLoading(BasePage page)
 {
 }
예제 #4
0
        public void Activate(EPages page, int serviceID)
        {
            if (CurrentPage != null)
            {
                PageUnLoading(CurrentPage);
                container.Children.Clear();
                CurrentPage.Dispose();
            }

            mainPage.serviceID = serviceID;
            CurrentPage = Activator.CreateInstance(pages[page]) as BasePage;

            CurrentPage.uiDriver = this;

            CurrentPage.container = mainPage;

            if (pages[page] == typeof(pageLogon))
            {
                LogOff(this, new EventArgs());
                (CurrentPage as pageLogon).AuthenticationSucceded += new AuthenticatedHandler(UIDriver_AuthenticationSucceded);
            }

            PageLoading(CurrentPage);
            if (CurrentPage is AuthenticatedPage)
            {
                AuthenticatedPage cp = CurrentPage as AuthenticatedPage;
                if (cp.Authenticate() && cp.Authorize())
                {
                    container.Children.Add(CurrentPage);
                    PageLoaded(CurrentPage);
                }
                else
                {
                    CurrentPage.Dispose();
                    Activate(EPages.Logon);
                }
            }
            else
            {
                container.Children.Add(CurrentPage);
                PageLoaded(CurrentPage);
            }
            mainPage.serviceID = serviceID;
        }