Ejemplo n.º 1
0
        public void PersistValues()
        {
            var settings  = GetFormSettings();
            var isChanged = Subsonic.IsSettingChanged(settings);

            if (isChanged)
            {
                var saved = Subsonic.SaveSettings(settings);
                if (saved && settings.UseIndexCache)
                {
                    var dialog = MessageBox.Show(
                        @"Settings saved successfully. Do you want to regenerate the local cache file?",
                        @"Regenerate local cache?",
                        MessageBoxButtons.YesNo,
                        MessageBoxIcon.Question,
                        MessageBoxDefaultButton.Button2);
                    if (dialog == DialogResult.Yes)
                    {
                        DeleteCacheFile();
                    }
                }

                if (Subsonic.IsInitialized)
                {
                    Subsonic.Refresh();
                }
                else
                {
                    Subsonic.SendNotificationsHandler.Invoke(Subsonic.Initialize()
                        ? Interfaces.Plugin.CallbackType.StorageReady
                        : Interfaces.Plugin.CallbackType.StorageFailed);
                }
            }
        }
Ejemplo n.º 2
0
        private void PersistValues()
        {
            var settings  = GetFormSettings();
            var isChanged = Subsonic.IsSettingChanged(settings);

            if (!isChanged)
            {
                return;
            }

            var saved = Subsonic.SaveSettings(settings);

            if (Subsonic.IsInitialized)
            {
                Subsonic.Refresh();
            }
            else
            {
                Subsonic.SendNotificationsHandler.Invoke(Subsonic.Initialize()
                   ? Interfaces.Plugin.CallbackType.StorageReady
                   : Interfaces.Plugin.CallbackType.StorageFailed);
            }
        }