public PageControl(Helper aHelper, Framework aXapp, string aResourcePath, string aXmlFileName) { // create the model class for this setup wizard ModelInstance.Create(aHelper); // load the page definitions xml PageDefinitions pageDef = new PageDefinitions(Path.Combine(aResourcePath, aXmlFileName)); // create the page manager PageManager.Create(pageDef, this); aXapp.AddCss("Linn.css"); // add all created pages to the xapp framework foreach (PageManager.Entry pageEntry in PageManager.Instance.Entries) { aXapp.AddPage(pageEntry.Page); } // create xapp views foreach (PageDefinitions.Page page in pageDef.Pages) { WizardView view = new WizardView(page, aResourcePath); aXapp.AddView(view); } }
private PageManager(PageDefinitions aPageDefinitions, PageControl aPageControl) { iEntries = new List <Entry>(); foreach (PageDefinitions.Page pageDef in aPageDefinitions.Pages) { Type pageType = Type.GetType(pageDef.Type, true); Page page = Activator.CreateInstance(pageType, aPageControl, pageDef) as Page; Assert.Check(page != null); iEntries.Add(new Entry(pageDef, page)); } }
// static methods for singleton access public static void Create(PageDefinitions aPageDefinitions, PageControl aPageControl) { Assert.Check(iInstance == null); iInstance = new PageManager(aPageDefinitions, aPageControl); }