void uiDriver_PageUnLoading(BasePage page) { ClearTray(); }
void uiDriver_PageLoaded(BasePage page) { txtPageName.Text = page.Title; }
void uiDriver_PageLoading(BasePage page) { }
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; }