/// <summary>
 /// Initializes a new instance of the ChangeStyleCopRule class.
 /// </summary>
 /// <param name="highlightingSettingsManager">
 /// The settings manager to use.
 /// </param>
 /// <param name="settingsStore">
 /// The settings store.
 /// </param>
 /// <param name="application">
 /// The UI application.
 /// </param>
 /// <param name="commonIconsComponent">
 /// The icon to use.
 /// </param>
 public ChangeStyleCopRule(
     HighlightingSettingsManager highlightingSettingsManager, ISettingsStore settingsStore, UIApplication application, IThemedIconManager commonIconsComponent)
 {
     this.highlightingSettingsManager = highlightingSettingsManager;
     this.settingsStore = settingsStore;
     this.commonIconsComponent = commonIconsComponent;
 }
    public TypeInterfaceToolWindowRegistrar(Lifetime lifetime,
                                    ToolWindowManager toolWindowManager,
                                    IShellLocks locks,
                                    ISettingsStore settingsStore,
                                    IActionManager actionManager,
                                    IActionBarManager actionBarManager,
                                    IShortcutManager shortcutManager,
                                    TypeInterfaceToolWindowDescriptor toolWindowDescriptor,
                                    ITheming theming,
                                    IThemedIconManager themedIconManager, IColorThemeManager colorThemeManager)
    {
      myLifetime = lifetime;
      myLocks = locks;
      mySettingsStore = settingsStore;
      myActionBarManager = actionBarManager;
      myTheming = theming;
      myThemedIconManager = themedIconManager;
      myColorThemeManager = colorThemeManager;

      myToolWindowClass = toolWindowManager.Classes[toolWindowDescriptor];
      myToolWindowClass.RegisterEmptyContent(
        lifetime,
        lt =>
          {
            var emptyLabel = new RichTextLabel { BackColor = SystemColors.Control, Dock = DockStyle.Fill };
            emptyLabel.RichTextBlock.Add(new RichText("No hierarchies open", new TextStyle(FontStyle.Bold)));
            emptyLabel.RichTextBlock.Add(
              new RichText("Use " + actionManager.GetHowToExecuteAction(shortcutManager, typeof(BrowseTypeHierarchyAction)), TextStyle.Default));
            emptyLabel.RichTextBlock.Add(new RichText("on a type to see hierarchy", TextStyle.Default));
            emptyLabel.RichTextBlock.Parameters = new RichTextBlockParameters(8, ContentAlignment.MiddleCenter);
            return emptyLabel.BindToLifetime(lt);
          });
    }
 public NancyReferenceProviderFactory(Lifetime lifetime, ISolution solution, ISettingsStore settingsStore, MvcReferenceProviderValidator providerValidator)
 {
     this.solution = solution;
     
     lifetime.AddBracket(() => providerValidator.OnChanged += FireOnChanged,
                         () => providerValidator.OnChanged -= FireOnChanged);
 }
 public PsiCodeFormatter(Lifetime lifetime, PsiLanguage language, ISettingsStore settingsStore, IViewable<IPsiCodeFormatterExtension> extensions, ISettingsOptimization settingsOptimization)
   : base(settingsStore)
 {
   myLanguage = language;
   myExtensions = extensions.ToLiveEnumerable(lifetime);
   mySettingsOptimization = settingsOptimization;
 }
示例#5
0
        public StateBucketService(ISettingsStore store)
        {
            var converter = new StateBucketConverter();

            bool loading = false;
            var writer = _cache.Connect()
                .ToCollection()
                .Select(buckets => converter.Convert(buckets.ToArray()))
                .Subscribe(state =>
                {
                    if (loading) return;
                    store.Save(SettingStoreKey, state);
                });

            //TODO: Make this error proof

            var initialState = store.Load(SettingStoreKey);
            var initialBuckets = converter.Convert(initialState);

            try
            {
                loading = true;
                _cache.AddOrUpdate(initialBuckets);
            }
            finally
            {
                loading = false;
            }

            _cleanUp = new CompositeDisposable(writer, _cache);
        }
示例#6
0
        public Smtp4devEngine(ISettingsStore settingsStore, IMessageStore messageStore)
        {
            _settingsStore = settingsStore;
            _settingsStore.Saved += OnSettingsChanged;
            _messageStore = messageStore;

            TryStart();
        }
 public ExternalConfigurationManager(ISettingsStore settings, TimeSpan interval, string environment)
 {
     this.settings = settings;
     this.interval = interval;
     this.CheckForConfigurationChangesAsync().Wait();
     this.changed = new Subject<KeyValuePair<string, string>>();
     this.Environment = environment;
 }
 /// <summary>
 /// Initializes a new instance of the ChangeStyleCopRuleAction class.
 /// </summary>
 /// <param name="highlightingSettingsManager">
 /// The settings manager to use.
 /// </param>
 /// <param name="settingsStore">
 /// The settings store.
 /// </param>
 /// <param name="severityId">
 /// The severityId.
 /// </param>
 /// <param name="commonIconsComponent">
 /// The icon to use.
 /// </param>
 public ChangeStyleCopRuleAction(
     HighlightingSettingsManager highlightingSettingsManager, ISettingsStore settingsStore, string severityId, IThemedIconManager commonIconsComponent)
 {
     this.highlightingSettingsManager = highlightingSettingsManager;
     this.settingsStore = settingsStore;
     this.commonIconsComponent = commonIconsComponent;
     this.HighlightID = severityId;
 }
        public DBSelectionViewModel(IMongoLabDataService mongoLabDataService, INavigationService navigationService, ISettingsStore settingsStore)
            : base (navigationService)
        {
            _mongoLabDataService = mongoLabDataService;
            _settingsStore = settingsStore;

            Refresh();
        }
 public AngularJsCodeFormatter(Lifetime lifetime, PsiLanguageType language, ISettingsStore settingsStore,
                               ISettingsOptimization settingsOptimization,
                               JavaScriptFormattingInfoProviderBase formattingProvider,
                               JavaScriptIndentingInfoProviderBase indentingProvider,
                               IViewable<IJavaScriptCodeFormatterExtension> extensions)
     : base(lifetime, language, settingsStore, settingsOptimization,
            formattingProvider, indentingProvider, extensions)
 {
 }
示例#11
0
        public AuthorizeViewModel(ISettingsStore settingsStore, INavigationService navigationService,
            IRtmServiceClient rtmManager)
            : base(navigationService)
        {
            this.settingsStore = settingsStore;
            this.rtmServiceClient = rtmManager;

            this.DoneCommand = new DelegateCommand(this.Done);
            this.IsBeingActivated();
        }
		/// <summary>
		/// Constructor
		/// </summary>
		private XmlValidationManager()
		{
			try
			{
				_settingsStore = SettingsStore.Create();
			}
			catch (NotSupportedException e)
			{
				Platform.Log(LogLevel.Debug, e);
			}
		}
        public ClassUsageTextStyleProvider(Lifetime lifetime, IThreading threading, IHighlighterCustomization highlighterCustomization,
                                           DefaultTextControlSchemeManager textControlSchemeManager, HighlightingSettingsManager highlightingSettingsManager, 
                                           ISettingsStore settingsStore)
        {
            this.threading = threading;
            this.highlighterCustomization = highlighterCustomization;
            this.highlightingSettingsManager = highlightingSettingsManager;
            this.settingsStore = settingsStore.BindToContextLive(lifetime, ContextRange.ApplicationWide);

            textControlSchemeManager.ColorsChanged.Advise(lifetime, Refresh);
        }
        public SettingsViewModel(ISettingsStore settingsStore, INavigationService navigationService)
            : base(navigationService)
        {
            this.settingsStore = settingsStore;

            this.CancelCommand = new DelegateCommand(this.Cancel);
            this.SubmitCommand = new DelegateCommand(this.Submit);
            this.GoMongoLabLoginCommand = new DelegateCommand(this.GoMongoLabLogin);

            ReadSetting();
        }
 public SilverlightMsTestMetadataExplorer(IShellLocks shellLocks, ISettingsStore settingsStore, SilverlightUnitTestProvider provider, Lifetime lifetime, ISolution solution, 
     IUnitTestElementManager unitTestElementManager, mstestlegacy::JetBrains.ReSharper.UnitTestProvider.MSTest.IMsTestElementFactory elementFactory, 
     IMainWindow mainWindow, IApplicationDescriptor applicationDescriptor)
 {
     Provider = provider;
     msTestAttributesProvider = new mstest10::JetBrains.ReSharper.UnitTestProvider.MSTest10.MsTestAttributesProvider();
     var msTestProvider = new mstest10::JetBrains.ReSharper.UnitTestProvider.MSTest10.MsTestProvider(shellLocks, settingsStore, msTestAttributesProvider, mainWindow, applicationDescriptor);
     var msTestServices = new mstest10::JetBrains.ReSharper.UnitTestProvider.MSTest10.MsTestServices(lifetime, solution, msTestProvider, settingsStore);
     msTestElementFactory = new mstest10::JetBrains.ReSharper.UnitTestProvider.MSTest10.MsTestElementFactory(msTestServices, unitTestElementManager);
     this.shellLocks = shellLocks;
     this.elementFactory = elementFactory;
 }
        public static void EmptyFallback(ISettingsStore store)
        {
            Assert.AreEqual(false, store.GetBool("bool_key"));
            Assert.AreEqual(false, store.GetBool("bool_key", false));
            Assert.AreEqual(true, store.GetBool("bool_key", true));

            bool[] boolArr = store.GetBoolArray("bool_arr_key");
            Assert.AreEqual(0, boolArr.Length);

            Assert.AreEqual(0, store.GetInt("int_key"));
            Assert.AreEqual(0, store.GetInt("int_key", 0));
            Assert.AreEqual(9, store.GetInt("int_key", 9));

            int[] intArr = store.GetIntArray("int_arr_key");
            Assert.AreEqual(0, intArr.Length);

            Assert.AreEqual(0, store.GetLong("long_key"));
            Assert.AreEqual(0, store.GetLong("long_key", 0));
            Assert.AreEqual(9000, store.GetLong("long_key", 9000));

            long[] longArr = store.GetLongArray("long_arr_key");
            Assert.AreEqual(0, longArr.Length);

            Assert.AreEqual(double.NaN, store.GetDouble("double_key"));
            Assert.AreEqual(0, store.GetDouble("double_key", 0));
            Assert.AreEqual(9.25, store.GetDouble("double_key", 9.25));

            double[] doubleArr = store.GetDoubleArray("double_arr_key");
            Assert.AreEqual(0, doubleArr.Length);

            Assert.AreEqual("", store.GetString("string_key"));
            Assert.AreEqual(null, store.GetString("string_key", null));
            Assert.AreEqual("Abc", store.GetString("string_key", "Abc"));

            string[] stringArr = store.GetStringArray("string_arr_key");
            Assert.AreEqual(0, stringArr.Length);

            Assert.AreEqual(DateTime.MinValue, store.GetDateTime("datetime_key"));
            Assert.AreEqual(new DateTime(2000, 1, 1), store.GetDateTime("datetime_key", new DateTime(2000, 1, 1)));

            DateTime[] dateTimeArr = store.GetDateTimeArray("datetime_arr_key");
            Assert.AreEqual(0, dateTimeArr.Length);

            Assert.AreEqual(TimeSpan.Zero, store.GetTimeSpan("timespan_key"));
            Assert.AreEqual(new TimeSpan(1, 2, 3), store.GetTimeSpan("timespan_key", new TimeSpan(1, 2, 3)));

            TimeSpan[] timeSpanArr = store.GetTimeSpanArray("timespan_arr_key");
            Assert.AreEqual(0, timeSpanArr.Length);

            NameValueCollection collection = store.GetNameValueCollection("namevaluecollection_key");
            Assert.AreEqual(0, collection.Count);
        }
        /// <summary>
        /// Initialises a new instance of the DemoPlugin class that implements the demo plugin.
        /// </summary>
        /// <param name="settingsStore">The application's settings store to share by this plugin.</param>
        /// <param name="pluginSettingsPrefix">The settings key prefix for this plugin in the application's settings store.</param>
        public DemoPlugin(ISettingsStore settingsStore, string pluginSettingsPrefix)
        {
            // EXPLANATION:
            // The prefix is here assigned by the host application, but it could also be defined by
            // the plugin itself, provided there are no collisions between different plugins or
            // multiple instances of them, or at least the properties in the same prefix.

            // Create an implementation of the plugin's settings interface
            Settings = SettingsAdapterFactory.New<IDemoPluginSettings>(settingsStore, pluginSettingsPrefix);

            // Set the demo value
            Settings.CustomValue = 5;
        }
 public ReflectedReferenceProviderValidator(Lifetime lifetime, IShellLocks shellLocks, ChangeManager changeManager, ISettingsStore settingsStore, ISolution solution)
 {
     var providerValidator = this;
     changeManager.Changed2.Advise(lifetime, Handler(solution, providerValidator));
     settingsStore.BindToContextLive(lifetime, ContextRange.Smart(solution.ToDataContext()))
         .GetValueProperty<MvcCustomReferencesSettings, bool>(lifetime, mvcSettings => mvcSettings.Enabled)
         .Change.Advise_NoAcknowledgement(lifetime,
             () =>
             {
                 if (lifetime.IsTerminated)
                     return;
                 shellLocks.ExecuteOrQueueReadLockEx(lifetime, "ReflectedReferenceProviderValidator", () => shellLocks.ExecuteWithWriteLock(providerValidator.FireOnChanged));
             });
 }
        public DatabaseViewModel(ISettingsStore settingsStore, IMongoLabDataService mongoLabDataService, INavigationService navigationService)
            : base(navigationService)
        {
            this.mongoLabDataService = mongoLabDataService;
            this.settingsStore = settingsStore;

            databases = new ObservableCollection<MongoLabDB>();

            this.RefreshCommand = new DelegateCommand(this.Refresh);
            this.AboutCommand = new DelegateCommand(this.About);
            this.SettingsCommand = new DelegateCommand(this.Settings);
            this.RepairDatabaseCommand = new DelegateCommand(this.RepairDatabase);

            Refresh();
        }
示例#20
0
		public T4CSharpTypingAssist(
			Lifetime lifetime,
			ISolution solution,
			ICommandProcessor commandProcessor,
			[NotNull] SkippingTypingAssist skippingTypingAssist,
			CachingLexerService cachingLexerService,
			ISettingsStore settingsStore,
			ITypingAssistManager typingAssistManager,
			IPsiServices psiServices,
			IExternalIntellisenseHost externalIntellisenseHost,
			ISmartDocCommentConfiguration smartDocCommentConfiguration)
			: base(
				lifetime, solution, commandProcessor, skippingTypingAssist, cachingLexerService, settingsStore,
				typingAssistManager, psiServices, externalIntellisenseHost, smartDocCommentConfiguration) {
		}
示例#21
0
        public LayoutService(ISettingsStore store, 
            ILogger logger,
            ISchedulerProvider schedulerProvider,
            IObjectProvider objectProvider,
            IApplicationStateNotifier stateNotifier)
        {
            _store = store;
            _logger = logger;
            _objectProvider = objectProvider;
            schedulerProvider.MainThread.Schedule(Restore);

            stateNotifier.StateChanged.Where(state => state == ApplicationState.ShuttingDown)
                .Subscribe(_ =>
                {
                    Write();
                });
        }
 public ExternalCodeFilesProvider(
     IProjectFileExtensions projectFileExtensions,
     PsiProjectFileTypeCoordinator projectFileTypeCoordinator,
     ChangeManager changeManager,
     IFileSystemTracker fileSystemTracker,
     IShellLocks shellLocks,
     DocumentManager documentManager,
     ISettingsStore settingsStore)
 {
     _projectFileExtensions = projectFileExtensions;
     _projectFileTypeCoordinator = projectFileTypeCoordinator;
     _changeManager = changeManager;
     _fileSystemTracker = fileSystemTracker;
     _shellLocks = shellLocks;
     _documentManager = documentManager;
     _settingsStore = settingsStore;
 }
 public SettingsUpgrader(ISettingsStore settingsStore, IApplicationDescriptor applicationDescriptor, IShellLocks locks, ProductSettingsLocation productSettingsLocation, RunsProducts.ProductConfigurations productConfigurations)
 {
   var boundSettingsStore = settingsStore.BindToContextTransient(ContextRange.ManuallyRestrictWritesToOneContext((l, contexts) => contexts.Empty));
   Expression<Func<ZenCodingSettings, bool>> isUpgradedProperty = settings => settings.IsUpgraded;
   if (!boundSettingsStore.GetValue(isUpgradedProperty))
   {
     var settingsComponent = new ShellSettingsComponent(applicationDescriptor, locks, productSettingsLocation, productConfigurations);
     var oldSettings = new Settings();
     settingsComponent.LoadSettings(oldSettings, XmlExternalizationScope.UserSettings, oldSettings.GetType().Name);
     for (int i = 0; i < oldSettings.FileAssociations.Count; i++)
     {
       var association = oldSettings.FileAssociations[i];
       boundSettingsStore.SetIndexedValue((ZenCodingSettings settings) => settings.FileAssociations, i, association);
     }
     
     boundSettingsStore.SetValue(isUpgradedProperty, true);
   }
 }
示例#24
0
		public TestCache(Lifetime lifetime, ISolution solution, IUnitTestingSettingsAccessor settingsAccessor,
			IShellLocks shellLocks, IPsiConfiguration psiConfiguration, ISettingsStore settingsStore,
			KarmaTestProvider testProvider, JasmineElementFactory jasmineFactory,
			IPersistentIndexManager persistentIndexManager, IJavaScriptDependencyManager javaScriptDependencyManager)
		{
			_lifetime = lifetime;
			_solution = solution;
			_settingsAccessor = settingsAccessor;
			_shellLocks = shellLocks;
			_psiConfiguration = psiConfiguration;
			_testProvider = testProvider;
			myJasmineFactory = jasmineFactory;
			_persistentIndexManager = persistentIndexManager;
			_javaScriptDependencyManager = javaScriptDependencyManager;
			_settingsStore = settingsStore.BindToContextLive(lifetime, ContextRange.ManuallyRestrictWritesToOneContext(solution.ToDataContext()), BindToContextFlags.Normal);
			_settingsStore.Changed.Advise(lifetime, OnSettingsChange);
			Active = new Property<bool>(lifetime, "KarmaTestCache", true);
		}
		public StartPage (ILoginStore store, ISettingsStore setting)
		{
			this.store = store;
			this.setting = setting;
			InitializeComponent ();
			BindingContext = this;

			if (store.HasLogin)
			{
				var data = store.GetLoginInfo();
				Username = data.Item1;
				Password = data.Item2;
				OnPropertyChanged(nameof(Username));
				OnPropertyChanged(nameof(Password));
			}

			DeviceId = setting.DeviceId;
			OnPropertyChanged(nameof(DeviceId));
		}
示例#26
0
        private void AccessSettings(ISettingsStore settingsStore, IAppSettings settings)
        {
            Debug.Assert(settings.View.IndentSize == 15);

            settingsStore.Set("View.IndentSize", 50);
            Debug.Assert(settings.View.IndentSize == 50);

            settingsStore.Set("Culture", "fr-FR");
            Debug.Assert(settings.Culture == "fr-FR");
            Debug.Assert(settings.GetCultureName() == "français (France)");

            Debug.Assert(settings.View.MonospaceFont == false);
            Debug.Assert(settings.View.FontName() == "Segoe UI");

            settings.View.IndentSize = 32;
            Debug.Assert(settings.View.IndentSize == 32);

            settings.View.MonospaceFont = true;
            Debug.Assert(settings.View.MonospaceFont == true);
            Debug.Assert(settings.View.FontName() == "Consolas");

            settings.PropertyChanged += settings_PropertyChanged;

            changeAction = e => Debug.Assert(false, "No change notification should occur.");
            settings.View.IndentSize = 32;

            changeAction = e => Debug.Assert(e.PropertyName == "View.IndentSize" && settings.View.IndentSize == 33);
            settings.View.IndentSize = 33;

            changeAction = e => Debug.Assert(e.PropertyName == "Culture" && settings.Culture == "en-GB");
            settings.Culture = "en-GB";

            settings.PropertyChanged -= settings_PropertyChanged;

            settings.TestNumbers = new[] { 1, 2, 3, 5, 8 };
            Debug.Assert(settings.TestNumbers.Select(_ => _.ToString()).Aggregate((a, b) => a + ", " + b) == "1, 2, 3, 5, 8");

            settings.TestNumbers = settings.TestNumbers.Concat(new[] { 13, 21, 34 }).ToArray();
            Debug.Assert(settings.TestNumbers.Select(_ => _.ToString()).Aggregate((a, b) => a + ", " + b) == "1, 2, 3, 5, 8, 13, 21, 34");
            Debug.Assert(settings.TestNumbersSum() == 87);
        }
 // This seems to be the earliest place from which we can get a settings store. We use
 // this to push in settings without having to use a real settings file. (It looks like
 // you can actually provide a test-local settings file, but for now, just providing it
 // programmatically is easiest.)
 protected override void WithProject(IProject project, ISettingsStore settingsStore, Action action)
 {
     // The docs all say to use plain BindToContext, but that has been marked as [Obsolete].
     // This appears to be what that obsolete method actually does. (And teh DataContexts.Empty
     // just copies what the test code uses when it creates a bound settings store to pass to the
     // code under test.)
     IContextBoundSettingsStore boundStore = settingsStore.BindToContextTransient(
         ContextRange.ManuallyRestrictWritesToOneContext(
         (lifetime, contexts) => settingsStore.DataContexts.Empty));
     boundStore.SetValue<OrderUsingsSettings, string>(
         settings => settings.OrderSpecificationXml,
         "<Groups xmlns=\"http://schemas.interact-sw.co.uk/OrderUsings/2014\">" +
         "<Group Priority='1' NamespacePattern='System*' />" +
         "<Group Priority='1' NamespacePattern='Microsoft*' />" +
         "<Space />" +
         "<Group Priority='9999' NamespacePattern='*' />" +
         "<Space />" +
         "<Group Priority='9999' NamespacePattern='*' AliasPattern='*' Type='Alias' />" +
         "</Groups>");
     base.WithProject(project, settingsStore, action);
 }
示例#28
0
        public AppSettingsViewModel(ISettingsStore settingsStore, INavigationService navigationService)
            : base(navigationService)
        {
            this._settingsStore = settingsStore;
            this._submitErrorInteractionRequest = new InteractionRequest<Notification>();

            this.CancelCommand = new DelegateCommand(this.Cancel);
            this.SubmitCommand = new DelegateCommand(this.Submit, () => this.CanSubmit);

            this.AuthorizationToken = settingsStore.AuthorizationToken;
            this.AuthorizationPermissions = settingsStore.AuthorizationPermissionsAsString;

            this.UserId = settingsStore.UserId;
            this.UserName = settingsStore.UserName;
            this.FullName = settingsStore.FullName;

            this.LocationServiceAllowed = settingsStore.LocationServiceAllowed;
            this.SubscribeToPushNotifications = settingsStore.SubscribeToPushNotifications;

            this.IsBeingActivated();
        }
		//TODO (CR Sept 2010): we can now save these values via ApplicationSettingsExtensions

		/// <summary>
		/// Saves any changes made to the rules document to the specified settings store.
		/// </summary>
		/// <param name="settingsStore"></param>
		public void Save(ISettingsStore settingsStore)
		{
			// need to save changes to XML doc
			if (!Initialized)
				return;

			var sb = new StringBuilder();
			var writer = new XmlTextWriter(new StringWriter(sb)) { Formatting = Formatting.Indented };
			_rulesDoc.Save(writer);
			var xml = sb.ToString();

			// if value has not changed, nothing to save
			if (xml == this.CustomRulesXml)
				return;

			var values = new Dictionary<string, string> { { "CustomRulesXml", xml } };

			settingsStore.PutSettingsValues(
				new SettingsGroupDescriptor(this.GetType()),
				null,
				null,
				values);
		}
示例#30
0
        /// <summary>
        /// Initializes a new instance of the <see cref="SettingsViewModel"/> class.
        /// </summary>
        /// <param name="settingsStore">
        /// The settings store.
        /// </param>
        private SettingsViewModel(ISettingsStore settingsStore, ISubscriptionStore subscriptionStore)
        {
            this.settingsStore = settingsStore;
            this.subscriptionStore = subscriptionStore;

            var settings = this.settingsStore.SubscriptionSettings;

            this.SubscriptionSettings =
                new ObservableCollection<SubscriptionSettingsViewModel>(
                    settings.Select(s => new SubscriptionSettingsViewModel(s, this.settingsStore)));

            this.DeleteSubscription = new RelayCommand(async model =>
                    {
                        var dialog = new MessageDialog("Do you really want to remove this subscription?");
                        dialog.Commands.Add(
                            new UICommand(
                                "Yes",
                                command =>
                                    {
                                        var setting = model as SubscriptionSettingsViewModel;

                                        if (setting == null)
                                        {
                                            return;
                                        }

                                        this.SubscriptionSettings.Remove(s => s.Id == setting.Id);

                                        this.subscriptionStore.Delete(setting.StreamKey);
                                        this.settingsStore.RemoveSubscriptionSetting(setting.Id);
                                    }));
                        dialog.Commands.Add(new UICommand("No"));
                        
                        await dialog.ShowAsync();
                    });
        }
示例#31
0
 public TypedSettingsStore(ISettingsStore store, IStorageConversions converter)
 {
     this.store     = store;
     this.converter = converter;
 }
示例#32
0
 void ISettingsContainer.LoadValues(ISettingsStore store)
 {
     store.LoadInstance(this);
 }
示例#33
0
 public T4CodeFormatter(ISettingsStore settingsStore)
     : base(settingsStore)
 {
 }
示例#34
0
 public void StoreValues(ISettingsStore store)
 {
     store.Set("Language", Language ?? "en");
 }
 public ProjectLexiconSettingsWritingSystemDataMapper(ISettingsStore settingsStore)
     : base(settingsStore)
 {
 }
示例#36
0
 public GeneralSettingsPanel(ISettingsStore store)
 {
     _store = store;
     _vm    = new GeneralSettingsPanelModel();
 }
示例#37
0
 public void LoadValues(ISettingsStore store)
 {
     Language = store.Get("Language", Language) ?? "en";
 }
示例#38
0
 private void SettingsChanged(ISettingsStore settings)
 {
     _playersUpdater.SetTimer(_settingsStoreSource.GetSettingsStore().PlayersUpdateSeconds);
     _bansUpdater.SetTimer(_settingsStoreSource.GetSettingsStore().BansUpdateSeconds);
 }
 public void StoreValues(ISettingsStore store)
 {
     store.StoreInstance(this);
     Oy.Publish("MapDocument:Viewport:SetFOV", FOV);
 }
示例#40
0
        public MainPageViewModel(AuthorizeHealthCommand authorizer, ExportSpreadsheetCommand exporter, ISettingsStore settings, INavigationService nav, IAnalytics analytics) : base(analytics)
        {
            _settings = settings;

            Exporter = exporter;
            AuthorizeHealthCommand = authorizer.GetCommand(() =>
            {
                OnPropertyChanged(nameof(NeedsHealthAuthorization));
                Exporter.Command.ChangeCanExecute();
            });

            GoToSettings = new Command(async() => await nav.Modal <SettingsViewModel>());
        }
示例#41
0
 void ISettingsContainer.LoadValues(ISettingsStore store)
 {
     store.LoadInstance(this);
     Oy.Publish("SelectTool:SetShow3DWidgets", Show3DWidgets ? "1" : "0");
 }
示例#42
0
 public CommonSettingStore(ISettingsStore settingsStore) => _settingsStore = settingsStore;
示例#43
0
 public void StoreValues(ISettingsStore store)
 {
     store.Set("Profiles", _profiles);
 }
示例#44
0
 public FixForSuppressingHighlightingSettingsManager([NotNull] Lifetime lifetime, [NotNull] ShellPartCatalogSet partsCatalogSet, [NotNull] ILanguages allLanguages,
                                                     [NotNull] ISettingsStore settingsStore, [NotNull] IEnumerable <ICustomConfigurableSeverityItemProvider> customConfigurableSeverityItemProviders, [NotNull] SettingsCacheManager cacheManger)
     : base(lifetime, partsCatalogSet, allLanguages, settingsStore, customConfigurableSeverityItemProviders, cacheManger)
 {
 }
        public UnityEditorProtocol(Lifetime lifetime, ILogger logger, UnityHost host,
                                   IScheduler dispatcher, IShellLocks locks, ISolution solution,
                                   ISettingsStore settingsStore, JetBrains.Application.ActivityTrackingNew.UsageStatistics usageStatistics,
                                   UnitySolutionTracker unitySolutionTracker, IThreading threading,
                                   UnityVersion unityVersion, NotificationsModel notificationsModel,
                                   IHostProductInfo hostProductInfo)
        {
            myPluginInstallations = new JetHashSet <FileSystemPath>();

            myComponentLifetime  = lifetime;
            myLogger             = logger;
            myDispatcher         = dispatcher;
            myLocks              = locks;
            mySolution           = solution;
            myUsageStatistics    = usageStatistics;
            myThreading          = threading;
            myUnityVersion       = unityVersion;
            myNotificationsModel = notificationsModel;
            myHostProductInfo    = hostProductInfo;
            myHost = host;
            myBoundSettingsStore = settingsStore.BindToContextLive(lifetime, ContextRange.Smart(solution.ToDataContext()));
            mySessionLifetimes   = new SequentialLifetimes(lifetime);

            if (solution.GetData(ProjectModelExtensions.ProtocolSolutionKey) == null)
            {
                return;
            }

            unitySolutionTracker.IsUnityProject.View(lifetime, (lf, args) =>
            {
                if (!args)
                {
                    return;
                }

                var solFolder = mySolution.SolutionDirectory;
                AdviseModelData(lifetime);

                // todo: consider non-Unity Solution with Unity-generated projects
                var protocolInstancePath = solFolder.Combine("Library/ProtocolInstance.json");
                protocolInstancePath.Directory.CreateDirectory();

                var watcher          = new FileSystemWatcher();
                watcher.Path         = protocolInstancePath.Directory.FullPath;
                watcher.NotifyFilter = NotifyFilters.LastWrite; //Watch for changes in LastWrite times
                watcher.Filter       = protocolInstancePath.Name;

                // Add event handlers.
                watcher.Changed += OnChanged;
                watcher.Created += OnChanged;

                lf.Bracket(() => { }, () =>
                {
                    watcher.Dispose();
                });

                watcher.EnableRaisingEvents = true; // Begin watching.
                // connect on start of Rider
                CreateProtocols(protocolInstancePath);
            });
        }
 public AuthorizeHealthCommand(IAuthorizer authorizer, IClock clock, IActionPresenter alertPresenter, IAnalytics analytics, ILogger logger, ISettingsStore settings)
 {
     _authorizer     = authorizer;
     _clock          = clock;
     _alertPresenter = alertPresenter;
     _analytics      = analytics;
     _logger         = logger;
     _settings       = settings;
 }
示例#47
0
 public LtgConfigWatcher(ISettingsStore settingsStore)
 {
     _boundSettings = settingsStore.BindToContextTransient(ContextRange.ApplicationWide);
     Initialize();
 }
示例#48
0
 protected FormatterResearchBase(ISettingsStore settingsStore) : base(settingsStore)
 {
 }
示例#49
0
 void ISettingsContainer.StoreValues(ISettingsStore store)
 {
     store.StoreInstance(this);
 }
 public void LoadValues(ISettingsStore store)
 {
     store.LoadInstance(this);
 }
示例#51
0
        public InvalidateOnMaximumLinesChange(Lifetime lifetime, Daemon daemon, ISettingsStore settingsStore)
        {
            var maxLines = settingsStore.Schema.GetScalarEntry((CleanCodeSettings s) => s.MethodTooLongMaximum);

            settingsStore.AdviseChange(lifetime, maxLines, daemon.Invalidate);
        }
示例#52
0
 protected abstract ISettingsStore ProvideStore(ISettingsStore innerStore);
        public AssetIndexingSupport(Lifetime lifetime, YamlSupport yamlSupport, SolutionCaches solutionCaches, ISolution solution, ISettingsStore settingsStore)
        {
            var settings = settingsStore.BindToContextLive(lifetime,
                                                           ContextRange.ManuallyRestrictWritesToOneContext(solution.ToDataContext()));

            IsEnabled = settings.GetValueProperty(lifetime, (UnitySettings key) => key.IsAssetIndexingEnabled);

            if (!yamlSupport.IsParsingEnabled.Value)
            {
                IsEnabled.Value = false;
            }

            IsEnabled.Change.Advise(lifetime, v =>
            {
                if (v.HasNew && v.New)
                {
                    yamlSupport.IsParsingEnabled.Value = true;
                    if (v.HasOld)
                    {
                        solutionCaches.PersistentProperties[UnityYamlDisableStrategy.SolutionCachesId] = false.ToString();
                    }
                }
            });
        }
        public InvalidateOnMaximumMethodArgumentsChange(Lifetime lifetime, Daemon daemon, ISettingsStore settingsStore)
        {
            var maxArguments =
                settingsStore.Schema.GetScalarEntry((CleanCodeSettings s) => s.TooManyMethodArgumentsMaximum);

            settingsStore.AdviseChange(lifetime, maxArguments, daemon.Invalidate);
        }
 public InfoBarService(IPackage package, ILogger logger, ISettingsStore settingsStore)
 {
     _package       = Preconditions.CheckNotNull(package, nameof(package));
     _logger        = Preconditions.CheckNotNull(logger, nameof(logger));
     _settingsStore = Preconditions.CheckNotNull(settingsStore, nameof(settingsStore));
 }
示例#56
0
        public ComplexityAnalysisInvalidateOnThresholdChange(Lifetime lifetime, IDaemon daemon, ISettingsStore settingsStore)
        {
            SettingsScalarEntry thresholdEntry = settingsStore.Schema.GetScalarEntry((ComplexityAnalysisSettings s) => s.Threshold);

            settingsStore.AdviseChange(lifetime, thresholdEntry, daemon.Invalidate);
        }
示例#57
0
        public YamlSupport(Lifetime lifetime, ISettingsStore settingsStore)
        {
            var boundStore = settingsStore.BindToContextLive(lifetime, ContextRange.ApplicationWide);

            IsParsingEnabled = boundStore.GetValueProperty(lifetime, (YamlSettings s) => s.EnableYamlParsing);
        }
 public HlslInShaderLabDummyFormatter(ISolution solution, CachingLexerService cachingLexerService, DocumentToProjectFileMappingStorage projectFileMappingStorage, IGlobalFormatSettingsService formatSettings,
                                      ISettingsStore settingsStore, ISettingsOptimization settingsOptimization) : base(solution, cachingLexerService, projectFileMappingStorage, formatSettings, settingsStore, settingsOptimization)
 {
 }
 public JavaScriptResearchFormatter(ISettingsStore settingsStore) : base(settingsStore)
 {
     Instance = this;
 }
示例#60
0
 public SettingsUpdateMailProcessor(string from, ISettingsStore settingsStore)
 {
     _from          = @from;
     _settingsStore = settingsStore;
 }