forked from codecadwallader/codemaid
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDiggingViewModel.cs
More file actions
151 lines (132 loc) · 5.59 KB
/
DiggingViewModel.cs
File metadata and controls
151 lines (132 loc) · 5.59 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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
using SteveCadwallader.CodeMaid.Model.CodeTree;
using SteveCadwallader.CodeMaid.Properties;
namespace SteveCadwallader.CodeMaid.UI.Dialogs.Options.Digging
{
/// <summary>
/// The view model for digging options.
/// </summary>
public class DiggingViewModel : OptionsPageViewModel
{
#region Constructors
/// <summary>
/// Initializes a new instance of the <see cref="DiggingViewModel" /> class.
/// </summary>
/// <param name="package">The hosting package.</param>
/// <param name="activeSettings">The active settings.</param>
public DiggingViewModel(CodeMaidPackage package, Settings activeSettings)
: base(package, activeSettings)
{
Mappings = new SettingsToOptionsList(ActiveSettings, this)
{
new SettingToOptionMapping<bool, bool>(x => ActiveSettings.Digging_CenterOnWhole, x => CenterOnWhole),
new SettingToOptionMapping<int, int>(x => ActiveSettings.Digging_ComplexityAlertThreshold, x => ComplexityAlertThreshold),
new SettingToOptionMapping<int, int>(x => ActiveSettings.Digging_ComplexityWarningThreshold, x => ComplexityWarningThreshold),
new SettingToOptionMapping<int, int>(x => ActiveSettings.Digging_IndentationMargin, x => IndentationMargin),
new SettingToOptionMapping<int, CodeSortOrder>(x => ActiveSettings.Digging_PrimarySortOrder, x => PrimarySortOrder),
new SettingToOptionMapping<bool, bool>(x => ActiveSettings.Digging_SecondarySortTypeByName, x => SecondarySortTypeByName),
new SettingToOptionMapping<bool, bool>(x => ActiveSettings.Digging_ShowItemComplexity, x => ShowItemComplexity),
new SettingToOptionMapping<bool, bool>(x => ActiveSettings.Digging_ShowItemMetadata, x => ShowItemMetadata),
new SettingToOptionMapping<bool, bool>(x => ActiveSettings.Digging_ShowItemTypes, x => ShowItemTypes),
new SettingToOptionMapping<bool, bool>(x => ActiveSettings.Digging_ShowMethodParameters, x => ShowMethodParameters),
new SettingToOptionMapping<bool, bool>(x => ActiveSettings.Digging_SynchronizeOutlining, x => SynchronizeOutlining)
};
}
#endregion Constructors
#region Overrides of OptionsPageViewModel
/// <summary>
/// Gets the header.
/// </summary>
public override string Header => Resources.DiggingViewModel_DiggingSpade;
#endregion Overrides of OptionsPageViewModel
#region Options
/// <summary>
/// Gets or sets the flag indicating if the view should center on the whole item upon navigation.
/// </summary>
public bool CenterOnWhole
{
get { return GetPropertyValue<bool>(); }
set { SetPropertyValue(value); }
}
/// <summary>
/// Gets or sets the complexity alert threshold.
/// </summary>
public int ComplexityAlertThreshold
{
get { return GetPropertyValue<int>(); }
set { SetPropertyValue(value); }
}
/// <summary>
/// Gets or sets the complexity warning threshold.
/// </summary>
public int ComplexityWarningThreshold
{
get { return GetPropertyValue<int>(); }
set { SetPropertyValue(value); }
}
/// <summary>
/// Gets or sets the indentation margin.
/// </summary>
public int IndentationMargin
{
get { return GetPropertyValue<int>(); }
set { SetPropertyValue(value); }
}
/// <summary>
/// Gets or sets the primary sort order.
/// </summary>
public CodeSortOrder PrimarySortOrder
{
get { return GetPropertyValue<CodeSortOrder>(); }
set { SetPropertyValue(value); }
}
/// <summary>
/// Gets or sets the flag indicating if secondary sorting during type sort should be on name.
/// </summary>
public bool SecondarySortTypeByName
{
get { return GetPropertyValue<bool>(); }
set { SetPropertyValue(value); }
}
/// <summary>
/// Gets or sets the flag indicating if item complexity should be shown.
/// </summary>
public bool ShowItemComplexity
{
get { return GetPropertyValue<bool>(); }
set { SetPropertyValue(value); }
}
/// <summary>
/// Gets or sets the flag indicating if item metadata should be shown.
/// </summary>
public bool ShowItemMetadata
{
get { return GetPropertyValue<bool>(); }
set { SetPropertyValue(value); }
}
/// <summary>
/// Gets or sets the flag indicating if item types should be shown.
/// </summary>
public bool ShowItemTypes
{
get { return GetPropertyValue<bool>(); }
set { SetPropertyValue(value); }
}
/// <summary>
/// Gets or sets the flag indicating if method parameters should be shown.
/// </summary>
public bool ShowMethodParameters
{
get { return GetPropertyValue<bool>(); }
set { SetPropertyValue(value); }
}
/// <summary>
/// Gets or sets the flag indicating if outlining should be synchronized with the code file.
/// </summary>
public bool SynchronizeOutlining
{
get { return GetPropertyValue<bool>(); }
set { SetPropertyValue(value); }
}
#endregion Options
}
}