示例#1
0
        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);
            }
        }
示例#2
0
        public XappController(IInvoker aInvoker, IHelper aHelper, INetworkManager aNetworkManager, Preferences aPreferences, PageBase aPageSettings, IUpdateListener aUpdateListener)
        {
            iNetworkManager = aNetworkManager;
            iNetworkManager.AdapterListChanged += HandleAdapterListChanged;

            iFramework = new Framework <TrackerSession>(OpenHome.Xen.Environment.AppPath + "/presentation");
            iFramework.AddCss("css/global.css");

            iRepeater = new CpDeviceReprogramListRepeater();

            iCache = new FirmwareCache(aHelper.DataPath.FullName);

            VersionInfoReader.EUpdateType updateTypes = VersionInfoReader.EUpdateType.Stable;
            if (aPreferences.FirmwareBeta)
            {
                updateTypes |= VersionInfoReader.EUpdateType.Beta;
            }
            iVersionReader = new VersionInfoReader(VersionInfoReader.kDefaultUpdatesUrl, 1000 * 60 * 60 * 12, aHelper.DataPath.FullName, updateTypes, iCache);

            XappView mainView = new XappView("main", OpenHome.Xen.Environment.AppPath + "/presentation");

            iMainPage = new MainPage(aInvoker, iNetworkManager.AdapterList.Adapter, aPreferences, aUpdateListener, iRepeater, "main", mainView.Id);
            iFramework.AddPage(iMainPage);
            iFramework.AddView(mainView);

            XappView updateView = new XappView("update", OpenHome.Xen.Environment.AppPath + "/presentation");

            iUpdatePage = new UpdatePage(aInvoker, iNetworkManager.AdapterList.Adapter, aPreferences, aUpdateListener, iRepeater, iCache, iVersionReader, "update", updateView.Id);
            iUpdatePage.NumUpdateableChanged += HandleNumUpdateableChanged;
            iFramework.AddPage(iUpdatePage);
            iFramework.AddView(updateView);

            XappView settingsView = new XappView(aPageSettings.Id, OpenHome.Xen.Environment.AppPath + "/presentation");

            iSettingsPage = aPageSettings;
            iFramework.AddPage(iSettingsPage);
            iFramework.AddView(settingsView);

            XappView diagnosticsView = new XappView("diagnostics", OpenHome.Xen.Environment.AppPath + "/presentation");

            iDiagnosticsPage = new DiagnosticsPage(aInvoker, aHelper, aPreferences, "diagnostics", diagnosticsView.Id);
            iDiagnosticsPage.NumDiagnosticsChanged += HandleNumDiagnosticsChanged;
            iFramework.AddPage(iDiagnosticsPage);
            iFramework.AddView(diagnosticsView);

            XappView advancedView = new XappView("advanced", OpenHome.Xen.Environment.AppPath + "/presentation");

            iAdvancedPage = new AdvancedPage(aInvoker, iNetworkManager.AdapterList.Adapter, aUpdateListener, iRepeater, iVersionReader, "advanced", advancedView.Id);
            iFramework.AddPage(iAdvancedPage);
            iFramework.AddView(advancedView);


            XappView aboutView = new XappView("about", OpenHome.Xen.Environment.AppPath + "/presentation");

            iAboutPage = new AboutPage(aInvoker, aHelper, "about", aboutView.Id);
            iFramework.AddPage(iAboutPage);
            iFramework.AddView(aboutView);

            iWebServer = new WebServer(iFramework);

            iVersionReader.Start();
        }