diff options
author | Michael Hutchinson <m.j.hutchinson@gmail.com> | 2015-02-09 23:55:46 +0300 |
---|---|---|
committer | Michael Hutchinson <m.j.hutchinson@gmail.com> | 2015-02-09 23:55:46 +0300 |
commit | 7c57f5d438e226da02bea94ae4fe7725b28d34a4 (patch) | |
tree | 33c8127b29f7d738b1dcd7292af29ca16e78ec71 /main/src/addins/WindowsPlatform/WindowsAPICodePack | |
parent | 558b8720ce839b4f9e0c9b91c07ce5ae97ec2c15 (diff) |
Fix Windows build
Diffstat (limited to 'main/src/addins/WindowsPlatform/WindowsAPICodePack')
-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");
|