Example #1
0
        public CpDeviceUpdateList(NetworkAdapter aAdapter, Preferences aPreferences, IUpdateListener aUpdateListener, CpDeviceReprogramListRepeater aRepeater, FirmwareCache aCache, VersionInfoReader aVersionInfoReader, ChangedHandler aAdded, ChangedHandler aRemoved)
        {
            iLock                 = new object();
            iDisposed             = false;
            iVersionInfoAvailable = false;

            iAdded   = aAdded;
            iRemoved = aRemoved;

            iPreferences = aPreferences;
            iPreferences.EventFirmwareBetaChanged += HandleFirmwareBetaChanged;

            iUpdateListener = aUpdateListener;
            iCache          = aCache;
            iVersionReader  = aVersionInfoReader;
            iVersionReader.EventVersionInfoAvailable += VersionInfoAvailable;

            iPendingList = new List <CpDeviceReprogrammable>();
            //iDeviceList = new CpDeviceReprogramList(Added, Removed);
            iRepeater          = aRepeater;
            iRepeater.Added   += Added;
            iRepeater.Removed += Removed;
            iDeviceUpdateList  = new List <CpDeviceUpdate>();

            SetAdapter(aAdapter);
        }
        public CpDeviceAdvancedList(NetworkAdapter aAdapter, IUpdateListener aUpdateListener, CpDeviceReprogramListRepeater aRepeater, VersionInfoReader aVersionReader, ChangedHandler aAdded, ChangedHandler aRemoved)
        {
            iLock     = new object();
            iDisposed = false;

            iUpdateListener = aUpdateListener;
            iVersionReader  = aVersionReader;

            iAdded   = aAdded;
            iRemoved = aRemoved;

            iDeviceListAdvanced = new List <CpDeviceAdvanced>();

            iRepeater          = aRepeater;
            iRepeater.Added   += Added;
            iRepeater.Removed += Removed;

            SetAdapter(aAdapter);
        }
Example #3
0
        public UpdatePage(IInvoker aInvoker, NetworkAdapter aAdapter, Preferences aPreferences, IUpdateListener aUpdateListener, CpDeviceReprogramListRepeater aRepeater, FirmwareCache aCache, VersionInfoReader aVersionReader, string aId, string aViewId)
            : base(aId, aViewId)
        {
            iInvoker = aInvoker;

            iLock = new object();
            iDeviceListUpdateable = new List <CpDeviceUpdate>();

            iReprogramList = new CpDeviceUpdateList(aAdapter, aPreferences, aUpdateListener, aRepeater, aCache, aVersionReader, Added, Removed);
        }
Example #4
0
        public AdvancedPage(IInvoker aInvoker, NetworkAdapter aAdapter, IUpdateListener aUpdateListener, CpDeviceReprogramListRepeater aRepeater, VersionInfoReader aVersionReader, string aId, string aViewId)
            : base(aId, aViewId)
        {
            iLock    = new object();
            iInvoker = aInvoker;

            iDeviceListAdvanced = new List <CpDeviceAdvanced>();
            iAdvancedList       = new CpDeviceAdvancedList(aAdapter, aUpdateListener, aRepeater, aVersionReader, Added, Removed);
        }
Example #5
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();
        }