Skip to content

Commit f66256f

Browse files
committed
More refactoring
1 parent f1d8283 commit f66256f

File tree

1 file changed

+3
-12
lines changed

1 file changed

+3
-12
lines changed

ScpControl/ScpUtil.cs

+3-12
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
using System.Collections.Specialized;
55
using System.Configuration;
66
using System.IO;
7+
using System.Linq;
78
using System.Reflection;
89
using System.Runtime.InteropServices;
910
using System.Windows.Forms;
@@ -1392,19 +1393,9 @@ private RegistryKey GetRegKey(SettingsProperty Property)
13921393
return RegistryKey;
13931394
}
13941395

1395-
private bool IsUserScoped(SettingsProperty Property)
1396+
private static bool IsUserScoped(SettingsProperty property)
13961397
{
1397-
foreach (DictionaryEntry Entry in Property.Attributes)
1398-
{
1399-
var Attribute = (Attribute) Entry.Value;
1400-
1401-
if (Attribute is UserScopedSettingAttribute)
1402-
{
1403-
return true;
1404-
}
1405-
}
1406-
1407-
return false;
1398+
return (from DictionaryEntry entry in property.Attributes select (Attribute) entry.Value).OfType<UserScopedSettingAttribute>().Any();
14081399
}
14091400

14101401
private string GetSubKeyPath()

0 commit comments

Comments
 (0)