diff options
Diffstat (limited to 'main/src/addins/WindowsPlatform/WindowsAPICodePack/Shell')
-rw-r--r-- | main/src/addins/WindowsPlatform/WindowsAPICodePack/Shell/PropertySystem/ShellProperty.cs | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/main/src/addins/WindowsPlatform/WindowsAPICodePack/Shell/PropertySystem/ShellProperty.cs b/main/src/addins/WindowsPlatform/WindowsAPICodePack/Shell/PropertySystem/ShellProperty.cs index ef4167876c..93650334e4 100644 --- a/main/src/addins/WindowsPlatform/WindowsAPICodePack/Shell/PropertySystem/ShellProperty.cs +++ b/main/src/addins/WindowsPlatform/WindowsAPICodePack/Shell/PropertySystem/ShellProperty.cs @@ -195,14 +195,15 @@ namespace Microsoft.WindowsAPICodePack.Shell.PropertySystem // Make sure we use the correct type
Debug.Assert(ValueType == ShellPropertyFactory.VarEnumToSystemType(Description.VarEnumType));
- if (typeof(T) != ValueType)
+ var type = typeof(T);
+ if (type != ValueType)
{
throw new NotSupportedException(
string.Format(System.Globalization.CultureInfo.InvariantCulture,
LocalizedMessages.ShellPropertyWrongType, ValueType.Name));
}
- if (value is Nullable)
+ if (type.IsGenericType && type.GetGenericTypeDefinition() == typeof(Nullable<>))
{
Type t = typeof(T);
PropertyInfo pi = t.GetProperty("HasValue");
|