Skip to content

Commit 12947e2

Browse files
committed
Rename collection element type to singular
1 parent 5bb8d81 commit 12947e2

File tree

7 files changed

+20
-19
lines changed

7 files changed

+20
-19
lines changed

Rubberduck.Core/Settings/ExperimentalFeatures.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
using System.Xml.Serialization;
22
using Rubberduck.UI;
3-
using Rubberduck.Resources;
3+
using Rubberduck.Resources.Experimentals;
44

55
namespace Rubberduck.Settings
66
{
7-
public class ExperimentalFeatures : ViewModelBase
7+
public class ExperimentalFeature : ViewModelBase
88
{
99
private bool _isEnabled;
1010
public bool IsEnabled
@@ -30,7 +30,7 @@ public string Key
3030
}
3131

3232
[XmlIgnore]
33-
public string DisplayValue => Key == null ? string.Empty : RubberduckUI.ResourceManager.GetString(Key);
33+
public string DisplayValue => Key == null ? string.Empty : ExperimentalNames.ResourceManager.GetString(Key);
3434

3535
public override string ToString()
3636
{
@@ -39,7 +39,7 @@ public override string ToString()
3939

4040
public override bool Equals(object obj)
4141
{
42-
return obj is ExperimentalFeatures value &&
42+
return obj is ExperimentalFeature value &&
4343
value.IsEnabled == IsEnabled &&
4444
value.Key == Key;
4545
}

Rubberduck.Core/Settings/GeneralSettings.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ public interface IGeneralSettings
2020
bool UserEditedLogLevel { get; set; }
2121
int MinimumLogLevel { get; set; }
2222
bool SetDpiUnaware { get; set; }
23-
List<ExperimentalFeatures> EnableExperimentalFeatures { get; set; }
23+
List<ExperimentalFeature> EnableExperimentalFeatures { get; set; }
2424
}
2525

2626
[SettingsSerializeAs(SettingsSerializeAs.Xml)]
@@ -73,7 +73,7 @@ public int MinimumLogLevel
7373

7474
public bool SetDpiUnaware { get; set; }
7575

76-
public List<ExperimentalFeatures> EnableExperimentalFeatures { get; set; } = new List<ExperimentalFeatures>();
76+
public List<ExperimentalFeature> EnableExperimentalFeatures { get; set; } = new List<ExperimentalFeature>();
7777

7878
public GeneralSettings()
7979
{

Rubberduck.Core/UI/Settings/GeneralSettingsViewModel.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ public GeneralSettingsViewModel(
6060
_hotkeyService = hotkeyService;
6161
}
6262

63-
public List<ExperimentalFeatures> ExperimentalFeatures { get; set; }
63+
public List<ExperimentalFeature> ExperimentalFeatures { get; set; }
6464

6565
public ObservableCollection<DisplayLanguageSetting> Languages { get; set; }
6666

@@ -307,9 +307,10 @@ private void TransferSettingsToView(IGeneralSettings general, IHotkeySettings ho
307307
_selectedLogLevel = LogLevels.First(l => l.Ordinal == general.MinimumLogLevel);
308308

309309
ExperimentalFeatures = _experimentalFeatureTypes
310+
// extract the resource key to use
310311
.SelectMany(s => s.CustomAttributes.Where(a => a.ConstructorArguments.Any()).Select(a => (string)a.ConstructorArguments.First().Value))
311312
.Distinct()
312-
.Select(s => new ExperimentalFeatures { IsEnabled = general.EnableExperimentalFeatures.SingleOrDefault(d => d.Key == s)?.IsEnabled ?? false, Key = s })
313+
.Select(s => new ExperimentalFeature { IsEnabled = general.EnableExperimentalFeatures.SingleOrDefault(d => d.Key == s)?.IsEnabled ?? false, Key = s })
313314
.ToList();
314315
}
315316

RubberduckTests/CodeExplorer/MockedCodeExplorer.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -431,9 +431,9 @@ private Configuration GetDefaultUnitTestConfig()
431431

432432
var generalSettings = new GeneralSettings
433433
{
434-
EnableExperimentalFeatures = new List<ExperimentalFeatures>
434+
EnableExperimentalFeatures = new List<ExperimentalFeature>
435435
{
436-
new ExperimentalFeatures()
436+
new ExperimentalFeature()
437437
}
438438
};
439439

RubberduckTests/IoCContainer/IoCRegistrationTests.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,9 @@ public void RegistrationOfRubberduckIoCContainerWithSC_NoException()
2828

2929
var initialSettings = new GeneralSettings
3030
{
31-
EnableExperimentalFeatures = new List<ExperimentalFeatures>
31+
EnableExperimentalFeatures = new List<ExperimentalFeature>
3232
{
33-
new ExperimentalFeatures()
33+
new ExperimentalFeature()
3434
}
3535
};
3636

@@ -55,7 +55,7 @@ public void RegistrationOfRubberduckIoCContainerWithoutSC_NoException()
5555
var addin = addInBuilder.Build().Object;
5656
var vbeNativeApi = new Mock<IVbeNativeApi>();
5757

58-
var initialSettings = new GeneralSettings {EnableExperimentalFeatures = new List<ExperimentalFeatures>()};
58+
var initialSettings = new GeneralSettings {EnableExperimentalFeatures = new List<ExperimentalFeature>()};
5959

6060
using (var container =
6161
new WindsorContainer().Install(new RubberduckIoCInstaller(ide, addin, initialSettings, vbeNativeApi.Object)))

RubberduckTests/IoCContainer/IoCResolvingTests.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,9 @@ public void ResolveInspections_NoException()
3131

3232
var initialSettings = new GeneralSettings
3333
{
34-
EnableExperimentalFeatures = new List<ExperimentalFeatures>
34+
EnableExperimentalFeatures = new List<ExperimentalFeature>
3535
{
36-
new ExperimentalFeatures()
36+
new ExperimentalFeature()
3737
}
3838
};
3939

@@ -74,9 +74,9 @@ public void ResolveRubberduckParserState_NoException()
7474

7575
var initialSettings = new GeneralSettings
7676
{
77-
EnableExperimentalFeatures = new List<ExperimentalFeatures>
77+
EnableExperimentalFeatures = new List<ExperimentalFeature>
7878
{
79-
new ExperimentalFeatures()
79+
new ExperimentalFeature()
8080
}
8181
};
8282

RubberduckTests/Settings/GeneralSettingsTests.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,9 @@ private Configuration GetDefaultConfig()
4646
Language = new DisplayLanguageSetting("en-US"),
4747
IsAutoSaveEnabled = false,
4848
AutoSavePeriod = 10,
49-
EnableExperimentalFeatures = new List<ExperimentalFeatures>
49+
EnableExperimentalFeatures = new List<ExperimentalFeature>
5050
{
51-
new ExperimentalFeatures()
51+
new ExperimentalFeature()
5252
}
5353
//Delimiter = '.'
5454
};

0 commit comments

Comments
 (0)