Пример #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);
        }
Пример #2
0
        public CpDeviceFacDefList(NetworkAdapter aAdapter, IUpdateListener aUpdateListener, CpDeviceReprogramListRepeater aRepeater, ChangedHandler aAdded, ChangedHandler aRemoved)
        {
            iLock     = new object();
            iDisposed = false;

            iAdded   = aAdded;
            iRemoved = aRemoved;

            iUpdateListener = aUpdateListener;

            //iDeviceList = new CpDeviceReprogramList(Added, Removed);
            iRepeater         = aRepeater;
            iDeviceFacDefList = new List <CpDeviceFacDef>();

            SetAdapter(aAdapter);
        }
Пример #3
0
        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);
        }
Пример #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);
        }
Пример #5
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);
        }
Пример #6
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();
        }
Пример #7
0
        public MainPage(IInvoker aInvoker, NetworkAdapter aAdapter, Preferences aPreferences, IUpdateListener aUpdateListener, CpDeviceReprogramListRepeater aRepeater, string aId, string aViewId)
            : base(aId, aViewId)
        {
            iInvoker = aInvoker;

            iPreferences = aPreferences;

            iLock = new object();
            iDeviceListRecognised = new List <CpDeviceRecognised>();

            List <IRecogniser> recognisers = new List <IRecogniser>();

            recognisers.Add(new RecogniserLinn());
            recognisers.Add(new RecogniserSonos());
            recognisers.Add(new RecogniserMediaServer());
            iRecogniserList = new CpDeviceRecogniserList(recognisers, Added, Removed);
        }