mirror of
https://github.com/claunia/SabreTools.git
synced 2025-12-16 19:14:27 +00:00
[Help] Cleanup
This commit is contained in:
@@ -36,33 +36,20 @@ namespace SabreTools.Library.Help
|
||||
get
|
||||
{
|
||||
if (_features == null)
|
||||
{
|
||||
_features = new Dictionary<string, Feature>();
|
||||
}
|
||||
|
||||
if (!_features.ContainsKey(name))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
return _features[name];
|
||||
}
|
||||
set
|
||||
{
|
||||
if (_features == null)
|
||||
{
|
||||
_features = new Dictionary<string, Feature>();
|
||||
}
|
||||
|
||||
if (_features.ContainsKey(name))
|
||||
{
|
||||
_features[name] = value;
|
||||
}
|
||||
else
|
||||
{
|
||||
_features.Add(name, value);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public Feature this[Feature subfeature]
|
||||
@@ -70,33 +57,20 @@ namespace SabreTools.Library.Help
|
||||
get
|
||||
{
|
||||
if (_features == null)
|
||||
{
|
||||
_features = new Dictionary<string, Feature>();
|
||||
}
|
||||
|
||||
if (!_features.ContainsKey(subfeature.Name))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
return _features[subfeature.Name];
|
||||
}
|
||||
set
|
||||
{
|
||||
if (_features == null)
|
||||
{
|
||||
_features = new Dictionary<string, Feature>();
|
||||
}
|
||||
|
||||
if (_features.ContainsKey(subfeature.Name))
|
||||
{
|
||||
_features[subfeature.Name] = value;
|
||||
}
|
||||
else
|
||||
{
|
||||
_features.Add(subfeature.Name, value);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -106,9 +80,7 @@ namespace SabreTools.Library.Help
|
||||
public void Add(Feature feature)
|
||||
{
|
||||
if (_features == null)
|
||||
{
|
||||
_features = new Dictionary<string, Feature>();
|
||||
}
|
||||
|
||||
lock (_features)
|
||||
{
|
||||
@@ -301,9 +273,8 @@ namespace SabreTools.Library.Help
|
||||
foreach (KeyValuePair<string, Feature> tempfeat in temp)
|
||||
{
|
||||
if (!enabled.ContainsKey(tempfeat.Key))
|
||||
{
|
||||
enabled.Add(tempfeat.Key, null);
|
||||
}
|
||||
|
||||
enabled[tempfeat.Key] = tempfeat.Value;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user