Beispiel #1
0
        private string InternalHandleNotificationsCommand(MsnConversation msnConversation, IList <string> arguments)
        {
            string contactMail = msnConversation.Contact.Account;

            lock (_notificationsLock)
            {
                EnsureNotificationContactFilter();

                bool   settingChanged = false;
                string onOff          = arguments.Count > 0 ? arguments[0].Trim() : String.Empty;
                if (onOff == "off")
                {
                    settingChanged = _notificationContactFilter.AddAddress(contactMail);
                }
                else if (onOff == "on")
                {
                    settingChanged = _notificationContactFilter.RemoveAddress(contactMail);
                }
                if (settingChanged)
                {
                    using (ConfigurationServiceAgent configurationAgent = new ConfigurationServiceAgent())
                    {
                        configurationAgent.SetStringValue(ConfigurationModule.Messenger, ConfigurationKey.Messenger.MsnNotificationFilterList, _notificationContactFilter.ToString());
                    }
                }
                return(_notificationContactFilter.ContainsAddress(contactMail) ? "Notifications are off." : "Notifications are on.");
            }
        }
Beispiel #2
0
        private void OnRestoreDefaults()
        {
            GUIDialogYesNo dlgYesNo = (GUIDialogYesNo)GUIWindowManager.GetWindow((int)GUIWindow.Window.WINDOW_DIALOG_YES_NO);

            if (dlgYesNo != null)
            {
                dlgYesNo.Reset();
                dlgYesNo.SetHeading(927);
                dlgYesNo.SetLine(1, Utility.GetLocalizedText(TextId.RestoreDefaults));
                dlgYesNo.SetLine(2, Utility.GetLocalizedText(TextId.AreYouSure));
                dlgYesNo.SetLine(3, string.Empty);
                dlgYesNo.SetDefaultToYes(false);
                dlgYesNo.DoModal(GetID);

                if (dlgYesNo.IsConfirmed)
                {
                    ConfigurationServiceAgent.SetBooleanValue(ConfigurationModule.Scheduler, ConfigurationKey.Scheduler.CreateVideoThumbnails, null);
                    ConfigurationServiceAgent.SetBooleanValue(ConfigurationModule.Scheduler, ConfigurationKey.Scheduler.AlwaysCreateMetadataFiles, null);
                    ConfigurationServiceAgent.SetStringValue(ConfigurationModule.Scheduler, ConfigurationKey.Scheduler.PreferredGuideSource, null);
                    ConfigurationServiceAgent.SetIntValue(ConfigurationModule.Scheduler, ConfigurationKey.Scheduler.PreRecordsSeconds, null);
                    ConfigurationServiceAgent.SetIntValue(ConfigurationModule.Scheduler, ConfigurationKey.Scheduler.PostRecordsSeconds, null);
                    ConfigurationServiceAgent.SetStringValue(ConfigurationModule.Scheduler, ConfigurationKey.Scheduler.DefaultKeepUntilMode, null);
                    ConfigurationServiceAgent.SetIntValue(ConfigurationModule.Scheduler, ConfigurationKey.Scheduler.DefaultKeepUntilValue, null);
                    ConfigurationServiceAgent.SetIntValue(ConfigurationModule.Scheduler, ConfigurationKey.Scheduler.FreeDiskSpaceInMB, null);
                    ConfigurationServiceAgent.SetIntValue(ConfigurationModule.Scheduler, ConfigurationKey.Scheduler.MinimumFreeDiskSpaceInMB, null);
                }
            }
        }
Beispiel #3
0
 private void SaveSettings()
 {
     Log.Debug("ServerSettingsBase: SaveSettings()");
     if (_autoCreateThumbsButton.IsEnabled)
     {
         ConfigurationServiceAgent.SetBooleanValue(ConfigurationModule.Scheduler, ConfigurationKey.Scheduler.CreateVideoThumbnails, _autoCreateThumbsButton.Selected);
     }
     if (_metaDataForRecsButton.IsEnabled)
     {
         ConfigurationServiceAgent.SetBooleanValue(ConfigurationModule.Scheduler, ConfigurationKey.Scheduler.AlwaysCreateMetadataFiles, _metaDataForRecsButton.Selected);
     }
     if (_guideSourceButton.IsEnabled)
     {
         ConfigurationServiceAgent.SetStringValue(ConfigurationModule.Scheduler, ConfigurationKey.Scheduler.PreferredGuideSource, _currentGuideSource.ToString());
     }
     if (_preRecordButton.IsEnabled)
     {
         ConfigurationServiceAgent.SetIntValue(ConfigurationModule.Scheduler, ConfigurationKey.Scheduler.PreRecordsSeconds, Int32.Parse(_preRecordButton.SpinLabel) * 60);
     }
     if (_postRecordButton.IsEnabled)
     {
         ConfigurationServiceAgent.SetIntValue(ConfigurationModule.Scheduler, ConfigurationKey.Scheduler.PostRecordsSeconds, Int32.Parse(_postRecordButton.SpinLabel) * 60);
     }
     if (_keepUntilModeButton.IsEnabled)
     {
         ConfigurationServiceAgent.SetStringValue(ConfigurationModule.Scheduler, ConfigurationKey.Scheduler.DefaultKeepUntilMode, _currentKeepUntilMode.ToString());
     }
     if (_keepUntilValueButton.IsEnabled)
     {
         ConfigurationServiceAgent.SetIntValue(ConfigurationModule.Scheduler, ConfigurationKey.Scheduler.DefaultKeepUntilValue, _currentKeepUntilValue);
     }
     if (_freeDiskSpaceSpinButton.IsEnabled)
     {
         ConfigurationServiceAgent.SetIntValue(ConfigurationModule.Scheduler, ConfigurationKey.Scheduler.FreeDiskSpaceInMB, Int32.Parse(_freeDiskSpaceSpinButton.SpinLabel) * 1000);
     }
     if (_minFreeDiskSpaceSpinButton.IsEnabled)
     {
         ConfigurationServiceAgent.SetIntValue(ConfigurationModule.Scheduler, ConfigurationKey.Scheduler.MinimumFreeDiskSpaceInMB, Int32.Parse(_minFreeDiskSpaceSpinButton.SpinLabel) * 1000);
     }
 }
Beispiel #4
0
        private string InternalHandleNotificationsCommand(MsnConversation msnConversation, IList<string> arguments)
        {
            string contactMail = msnConversation.Contact.Account;
            lock (_notificationsLock)
            {
                EnsureNotificationContactFilter();

                bool settingChanged = false;
                string onOff = arguments.Count > 0 ? arguments[0].Trim() : String.Empty;
                if (onOff == "off")
                {
                    settingChanged = _notificationContactFilter.AddAddress(contactMail);
                }
                else if (onOff == "on")
                {
                    settingChanged = _notificationContactFilter.RemoveAddress(contactMail);
                }
                if (settingChanged)
                {
                    using (ConfigurationServiceAgent configurationAgent = new ConfigurationServiceAgent())
                    {
                        configurationAgent.SetStringValue(ConfigurationModule.Messenger, ConfigurationKey.Messenger.MsnNotificationFilterList, _notificationContactFilter.ToString());
                    }
                }
                return _notificationContactFilter.ContainsAddress(contactMail) ? "Notifications are off." : "Notifications are on.";
            }
        }