public InvalidateOnMaximumMethodArgumentsChange(Lifetime lifetime, Daemon daemon, ISettingsStore settingsStore) { var maxArguments = settingsStore.Schema.GetScalarEntry((CleanCodeSettings s) => s.TooManyMethodArgumentsMaximum); settingsStore.AdviseChange(lifetime, maxArguments, daemon.Invalidate); }
public UnitySettingsChangedHandler(Lifetime lifetime, ISolution solution, IThreading threading, ISettingsStore settingsStore) { settingsStore.AdviseChange(lifetime, settingsStore.Schema.GetKey <UnitySettings>(), () => { if (threading.Dispatcher.IsAsyncBehaviorProhibited) { InvalidateDaemon(solution); } else { threading.ReentrancyGuard.ExecuteOrQueue("UnitySettingsChangedHandler", () => InvalidateDaemon(solution)); } }); }
public TodoItemsCountProvider( Lifetime lifetime, IPrimaryTodoManager primaryTodoManager, SolutionSettingsCache solutionSettingsCache, TodoItemsCountDefinitionsCachedSettingsReader todoItemsCountDefinitionsCachedSettingsReader, IEnumerable <ITodoItemsCountConsumer> todoItemsCountConsumers, ISettingsStore settingsStore) { _primaryTodoManager = primaryTodoManager; _settingsCache = solutionSettingsCache; _todoItemsCountDefinitionsCachedSettingsReader = todoItemsCountDefinitionsCachedSettingsReader; _todoItemsCountConsumers = todoItemsCountConsumers.ToIReadOnlyList(); _primaryTodoManager.FilesWereUpdated.Advise(lifetime, files => { // Check for invalid changed files, else we'll get "not valid" exceptions in the 'AllItems' access // later (at least as observed during unit test shut down): if (files.WhereNotNull().All(x => x.IsValid())) { UpdateTodoItemsCounts(); } }); var settingsCacheGetDataSequentialLifeTime = new SequentialLifetimes(lifetime); _currentSettingsCacheLifeTime = settingsCacheGetDataSequentialLifeTime.Next(); settingsStore.AdviseChange(lifetime, _todoItemsCountDefinitionsCachedSettingsReader.KeyExposed, () => { // We use the following lifetime to solve the issue that this 'ISettingsStore.AdviseChange()' callback // arrives earlier than the one used in the cache. => The cache has still the old value when accessed // in 'UpdateTodoItemsCounts()'. => Terminate the cache lifetime explicitly. _currentSettingsCacheLifeTime = settingsCacheGetDataSequentialLifeTime.Next(); UpdateTodoItemsCounts(); }); foreach (var consumer in _todoItemsCountConsumers) { consumer.UpdateRequestSignal.Advise(lifetime, () => { UpdateTodoItemsCounts(); }); } // IDEA: Combine the three event sources and execute update in background thread? }
public DisposableFunctionAnalysisInvalidateOnSettingsChange(Lifetime lifetime, Daemon daemon, ISettingsStore settingsStore) { var thresholdEntry = settingsStore.Schema.GetScalarEntry((DisposePluginSettings s) => s.MaxLevel); settingsStore.AdviseChange(lifetime, thresholdEntry, daemon.Invalidate); }
public InvalidateOnMaximumLinesChange(Lifetime lifetime, Daemon daemon, ISettingsStore settingsStore) { var maxLines = settingsStore.Schema.GetScalarEntry((CleanCodeSettings s) => s.MethodTooLongMaximum); settingsStore.AdviseChange(lifetime, maxLines, daemon.Invalidate); }
public InvalidateOnMaximumMethodsPerClass(Lifetime lifetime, Daemon daemon, ISettingsStore settingsStore) { var maxDepth = settingsStore.Schema.GetScalarEntry((CleanCodeSettings s) => s.ClassTooBigMaximum); settingsStore.AdviseChange(lifetime, maxDepth, daemon.Invalidate); }
public InvalidateOnMaximumLinesChange(Lifetime lifetime, Daemon daemon, ISettingsStore settingsStore) { var maxLines = settingsStore.Schema.GetScalarEntry((CleanCodeSettings s) => s.MethodTooLongMaximum); settingsStore.AdviseChange(lifetime, maxLines, daemon.Invalidate); }
public InjectionHappyDetectorInvalidateOnMaximumArgumentsChange(Lifetime lifetime, Daemon daemon, ISettingsStore settingsStore) { SettingsScalarEntry maxParams = settingsStore.Schema.GetScalarEntry((InjectionHappyDetectorSettings s) => s.MaximumParameters); settingsStore.AdviseChange(lifetime, maxParams, daemon.Invalidate); }
public InvalidateOnSettingsChange(Lifetime lifetime, IDaemon daemon, ISettingsStore settingsStore) { var settingsKey = settingsStore.Schema.GetKey <CleanCodeSettings>(); settingsStore.AdviseChange(lifetime, settingsKey, daemon.Invalidate); }
public InvalidateOnMaximumChainedCalls(Lifetime lifetime, Daemon daemon, ISettingsStore settingsStore) { var maxDepth = settingsStore.Schema.GetScalarEntry((CleanCodeSettings s) => s.TooManyChainedReferencesMaximum); settingsStore.AdviseChange(lifetime, maxDepth, daemon.Invalidate); }
public InvalidateOnMinimumMethodNameLenghtChange(Lifetime lifetime, Daemon daemon, ISettingsStore settingsStore) { var minMethodNameLenght = settingsStore.Schema.GetScalarEntry((CleanCodeSettings s) => s.MethodNameNotMeaningfulMinimumEnabled); settingsStore.AdviseChange(lifetime, minMethodNameLenght, daemon.Invalidate); }
public FlagsMethodArgumentsChange(Lifetime lifetime, Daemon daemon, ISettingsStore settingsStore) { var minMethodNameLenght = settingsStore.Schema.GetScalarEntry((CleanCodeSettings s) => s.FlagMethodArgumentsMinimum); settingsStore.AdviseChange(lifetime, minMethodNameLenght, daemon.Invalidate); }
public InvalidateOnMinimumMethodNameLenghtChange(Lifetime lifetime, Daemon daemon, ISettingsStore settingsStore) { var minMethodNameLenght = settingsStore.Schema.GetScalarEntry((CleanCodeSettings s) => s.MethodNameNotMeaningfulMinimumEnabled); settingsStore.AdviseChange(lifetime, minMethodNameLenght, daemon.Invalidate); }
public InvalidateOnMaximumMethodArgumentsChange(Lifetime lifetime, Daemon daemon, ISettingsStore settingsStore) { var maxArguments = settingsStore.Schema.GetScalarEntry((CleanCodeSettings s) => s.TooManyMethodArgumentsMaximum); settingsStore.AdviseChange(lifetime, maxArguments, daemon.Invalidate); }
public InvalidateOnSettingsChange(Lifetime lifetime, IDaemon daemon, ISettingsStore settingsStore) { var settingsKey = settingsStore.Schema.GetKey<CleanCodeSettings>(); settingsStore.AdviseChange(lifetime, settingsKey, daemon.Invalidate); }
public InvalidateOnMaximumDependenciesChange(Lifetime lifetime, Daemon daemon, ISettingsStore settingsStore) { var maxParams = settingsStore.Schema.GetScalarEntry((CleanCodeSettings s) => s.TooManyDependenciesMaximum); settingsStore.AdviseChange(lifetime, maxParams, daemon.Invalidate); }
public ComplexityAnalysisInvalidateOnThresholdChange(Lifetime lifetime, IDaemon daemon, ISettingsStore settingsStore) { SettingsScalarEntry thresholdEntry = settingsStore.Schema.GetScalarEntry((ComplexityAnalysisSettings s) => s.Threshold); settingsStore.AdviseChange(lifetime, thresholdEntry, daemon.Invalidate); }
public InvalidateOnExcessiveIndentationChange(Lifetime lifetime, Daemon daemon, ISettingsStore settingsStore) { var maxDepth = settingsStore.Schema.GetScalarEntry((CleanCodeSettings s) => s.ExcessiveIndentationMaximum); settingsStore.AdviseChange(lifetime, maxDepth, daemon.Invalidate); }
public ComplexityAnalysisInvalidateOnThresholdChange(Lifetime lifetime, Daemon.Daemon daemon, ISettingsStore settingsStore) { SettingsScalarEntry thresholdEntry = settingsStore.Schema.GetScalarEntry((ComplexityAnalysisSettings s) => s.Threshold); settingsStore.AdviseChange(lifetime, thresholdEntry, daemon.Invalidate); }
public ComplexityAnalysisInvalidateOnThresholdChange(Lifetime lifetime, IDaemon daemon, ISettingsStore settingsStore) { var settingsKey = settingsStore.Schema.GetKey<CyclomaticComplexityAnalysisSettings>(); settingsStore.AdviseChange(lifetime, settingsKey, daemon.Invalidate); }
public InvalidateOnMaximumMethodsPerClass(Lifetime lifetime, Daemon daemon, ISettingsStore settingsStore) { var maxDepth = settingsStore.Schema.GetScalarEntry((CleanCodeSettings s) => s.ClassTooBigMaximum); settingsStore.AdviseChange(lifetime, maxDepth, daemon.Invalidate); }
public InvalidateOnMaximumChainedCalls(Lifetime lifetime, Daemon daemon, ISettingsStore settingsStore) { var maxDepth = settingsStore.Schema.GetScalarEntry((CleanCodeSettings s) => s.TooManyChainedReferencesMaximum); settingsStore.AdviseChange(lifetime, maxDepth, daemon.Invalidate); }
public InvalidateOnExcessiveIndentationChange(Lifetime lifetime, Daemon daemon, ISettingsStore settingsStore) { var maxDepth = settingsStore.Schema.GetScalarEntry((CleanCodeSettings s) => s.ExcessiveIndentationMaximum); settingsStore.AdviseChange(lifetime, maxDepth, daemon.Invalidate); }
public ComplexityAnalysisInvalidateOnThresholdChange(Lifetime lifetime, IDaemon daemon, ISettingsStore settingsStore) { var settingsKey = settingsStore.Schema.GetKey <CyclomaticComplexityAnalysisSettings>(); settingsStore.AdviseChange(lifetime, settingsKey, daemon.Invalidate); }
public InvalidateOnMaximumDependenciesChange(Lifetime lifetime, Daemon daemon, ISettingsStore settingsStore) { var maxParams = settingsStore.Schema.GetScalarEntry((CleanCodeSettings s) => s.TooManyDependenciesMaximum); settingsStore.AdviseChange(lifetime, maxParams, daemon.Invalidate); }