//---------------------------------------------------------------------------------------------------- public void LaunchPage(PageIdentifier pageId) { this.SubPage = pageId.CreateAndGetPageObj(); jRoot.find(".PageContent").html(""); jRoot.find(".PageContent").append(this.SubPage.Get_jRoot()); this.SubPage.Open(); BasePage.WindowResized(); }
//---------------------------------------------------------------------------------------------------- public void Open_Sub() { BasePage.WindowResized(); if (window.location.hash == "") { window.location.hash = "#00-Home"; } PageIdentifier.GetFromUrlHash().Launch(); // this needs to be called at least one time to setup KeyboardController: //var keyboardController = Keyboard.KeyboardController.GetFromDocument(); // turned off in ASPdatabase }
public void OnWindow_HashChange() { if (this.IgnoreNext_HashChange) { this.IgnoreNext_HashChange = false; return; } document.title = "ASPdatabase.NET"; var newPageIdentifier = PageIdentifier.GetFromUrlHash(); if (this.SubPage.PageId.PageType == newPageIdentifier.PageType) { this.SubPage.PageId = newPageIdentifier; } else { newPageIdentifier.Launch(); } }
//------------------------------------------------------------------------------------------ static -- public static PageIdentifier GetFromUrlHash() { var rtn = new PageIdentifier(PageTypes.StartPage); var arr = window.location.hash.replace("#", "").split("-"); if (arr.length > 0) // clean & build this out later { if (arr[0].toLowerCase() == "manageassets") { window.location.href = "#00-ManageAssets"; } } var pageTypeInt = IntStatic.Parse(arr[0], 0); var allEnumInts = GetAllPageTypesInts(); bool pageTypeIsValid = false; for (int i = 0; i < allEnumInts.Length; i++) { if (allEnumInts[i] == pageTypeInt) { pageTypeIsValid = true; } } rtn.PageType = PageTypes.StartPage; if (pageTypeIsValid) { PageTypes tmpPageType = PageTypes.StartPage; eval("tmpPageType = pageTypeInt;"); rtn.PageType = tmpPageType; //rtn.PageType = pageTypeInt.As<PageTypes>(); } else { window.location.hash = ""; } if (arr.length > 1) { rtn.PageParam1 = arr[1]; } if (arr.length > 2) { rtn.PageParam2 = arr[2]; } if (arr.length > 3) { rtn.PageParam3 = arr[3]; } if (arr.length > 4) { rtn.PageParam4 = arr[4]; } if (arr.length > 5) { rtn.PageParam5 = arr[5]; } return(rtn); }