private DocumentReadyDataForNonDefaultLocation GetDocumentReadyDataForNonDefaultLocation(Location location, string cshtmlFile) { string icon, title, baseFileName, previousCurrentNextResource; string[] tabNames, v; bool stop; int i; DocumentReadyDataForNonDefaultLocation data; data = new DocumentReadyDataForNonDefaultLocation(location, cshtmlFile); baseFileName = string.Format("Page{0}Menu{1}Sub{2}Sub{3}.txt", location.Page, location.Menu, location.Sub1, location.Sub2); icon = GetPageEntity(PageEntity.Icon, baseFileName); title = GetPageEntity(PageEntity.Title, baseFileName); if (!string.IsNullOrEmpty(icon)) { data.Icon = icon; } if (!string.IsNullOrEmpty(title)) { data.Title = title; } baseFileName = string.Format("Page{0}Menu{1}Sub{2}Sub{3}Tab{4}.txt", location.Page, location.Menu, location.Sub1, location.Sub2, location.Tab); previousCurrentNextResource = GetPageEntity(PageEntity.LocationResource, baseFileName); if (!string.IsNullOrEmpty(previousCurrentNextResource)) { v = previousCurrentNextResource.Split(' '); data.PreviousResource = int.Parse(v[0]); data.CurrentResource = int.Parse(v[1]); data.NextResource = int.Parse(v[2]); } baseFileName = string.Format("Page{0}Menu{1}Sub{2}Sub{3}Tab", location.Page, location.Menu, location.Sub1, location.Sub2); tabNames = GetTabNames(baseFileName); stop = false; i = 0; while ((i < 10) && (!stop)) { if (!string.IsNullOrEmpty(tabNames[i])) { data.TabNames[i] = tabNames[i]; } else { stop = true; } i++; } return(data); }
private DataDefaultLocation GetDefaultDataForNewLocation(Location location) { DocumentReadyDataForNonDefaultLocation data = GetDocumentReadyDataForNonDefaultLocation(location, ""); DataDefaultLocation dataDefaultLocation = new DataDefaultLocation(data); string text = GetPageEntity(PageEntity.Text, string.Format("Page{0}Menu{1}Sub{2}Sub{3}Tab{4}.txt", location.Page, location.Menu, location.Sub1, location.Sub2, location.Tab)); if (!string.IsNullOrEmpty(text)) { dataDefaultLocation.Width = text.Substring(0, 6).Trim(); dataDefaultLocation.Height = text.Substring(6, 6).Trim(); dataDefaultLocation.Text = text.Substring(12); } return(dataDefaultLocation); }