Beispiel #1
0
        /// <inheritdoc />
        public void Dispose()
        {
            try { UpdateTrigger?.Dispose(); }
            catch { /* at least we tried */ }

            DeviceDefinitions.Clear();
        }
Beispiel #2
0
        public override void Dispose()
        {
            foreach (OpenRGBClient?client in _clients)
            {
                try { client?.Dispose(); }
                catch { /* at least we tried */ }
            }

            _clients.Clear();
            DeviceDefinitions.Clear();
            Devices = Enumerable.Empty <IRGBDevice>();
        }
Beispiel #3
0
 /// <summary>
 /// Инициализация при переходе на представление
 /// </summary>
 /// <param name="deviceDefinitionCreator"></param>
 internal void Initialize(Func <IDeviceDefinitionViewModel> deviceDefinitionCreator)
 {
     DeviceDefinitions.Clear();
     //  _devicesContainerService.LoadDevicesDefinitions();
     if (_devicesContainerService.Creators == null)
     {
         return;
     }
     if (_devicesContainerService.Creators.Count == 0)
     {
         return;
     }
     foreach (IDeviceCreator creator in _devicesContainerService.Creators)
     {
         IDeviceDefinitionViewModel deviceDefinition = deviceDefinitionCreator();
         deviceDefinition.Model = creator;
         DeviceDefinitions.Add(deviceDefinition);
     }
 }