Exemple #1
0
        public static void Save(Settings settings)
        {
            if (settings == null) throw new ArgumentNullException(nameof(settings));

            var storage = StorageService.Instance;
            if (storage == null)
                throw new InvalidOperationException("StorageService is not initialized");
            storage.SetInt32(StorageKeys.ForegroundOpacity, settings.Opacity);
            storage.SetBoolean(StorageKeys.IsFilteringEnabled, settings.IsFilteringEnabled);
            storage.SetStringArray(StorageKeys.Blacklist, settings.Blacklist?.ToArray());

            var textPropertiesService = TextPropertiesService.Instance;
            if (textPropertiesService == null)
                throw new InvalidOperationException("TextPropertiesService not initialized");
            textPropertiesService.UpdateTextPropertiesFromSettings();
            Bus.Publish(new SettingsChangedMessage());
        }
Exemple #2
0
 protected bool Equals(Settings other)
 {
     return Opacity == other.Opacity && IsFilteringEnabled == other.IsFilteringEnabled &&
            Equals(Blacklist, other.Blacklist);
 }