Esempio n. 1
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);
        }
Esempio n. 2
0
        private void Removed(CpDeviceUpdateList aList, CpDeviceUpdate aDevice)
        {
            lock (iLock)
            {
                Send("UpdateableDeviceRemoved", aDevice.MacAddress);

                aDevice.Changed         -= Changed;
                aDevice.ProgressChanged -= Progress;
                aDevice.MessageChanged  -= Message;
                iDeviceListUpdateable.Remove(aDevice);
            }

            if (NumUpdateableChanged != null)
            {
                NumUpdateableChanged(this, EventArgs.Empty);
            }
        }
Esempio n. 3
0
        private void Added(CpDeviceUpdateList aList, CpDeviceUpdate aDevice)
        {
            lock (iLock)
            {
                iDeviceListUpdateable.Add(aDevice);
                iDeviceListUpdateable.Sort();
                int index = iDeviceListUpdateable.IndexOf(aDevice);

                AddDevice(aDevice, index);
                aDevice.Changed         += Changed;
                aDevice.ProgressChanged += Progress;
                aDevice.MessageChanged  += Message;
            }

            if (NumUpdateableChanged != null)
            {
                NumUpdateableChanged(this, EventArgs.Empty);
            }
        }