forked from lurumad/CleanCode
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSimpleCheck.cs
More file actions
36 lines (29 loc) · 1.01 KB
/
Copy pathSimpleCheck.cs
File metadata and controls
36 lines (29 loc) · 1.01 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
using JetBrains.Application.Settings;
using JetBrains.ReSharper.Daemon.Stages;
using JetBrains.ReSharper.Psi.Tree;
namespace CleanCode.Features
{
public abstract class SimpleCheck<TElement, TThreshold> where TElement : ITreeNode
{
private readonly IContextBoundSettingsStore settingsStore;
protected SimpleCheck(IContextBoundSettingsStore settingsStore)
{
this.settingsStore = settingsStore;
}
public void ExecuteIfEnabled(TElement methodDeclaration, IHighlightingConsumer context)
{
if (!IsEnabled)
{
return;
}
ExecuteCore(methodDeclaration, context);
}
protected abstract void ExecuteCore(TElement element, IHighlightingConsumer consumer);
protected abstract TThreshold Threshold { get; }
protected abstract bool IsEnabled { get; }
protected IContextBoundSettingsStore SettingsStore
{
get { return settingsStore; }
}
}
}