diff options
Diffstat (limited to 'main/src/addins/WindowsPlatform')
-rw-r--r-- | main/src/addins/WindowsPlatform/WindowsAPICodePack/Shell/PropertySystem/ShellProperty.cs | 5 | ||||
-rw-r--r-- | main/src/addins/WindowsPlatform/WindowsPlatform/WindowsPlatform.cs | 10 |
2 files changed, 8 insertions, 7 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");
diff --git a/main/src/addins/WindowsPlatform/WindowsPlatform/WindowsPlatform.cs b/main/src/addins/WindowsPlatform/WindowsPlatform/WindowsPlatform.cs index 1749628239..229063160d 100644 --- a/main/src/addins/WindowsPlatform/WindowsPlatform/WindowsPlatform.cs +++ b/main/src/addins/WindowsPlatform/WindowsPlatform/WindowsPlatform.cs @@ -34,18 +34,18 @@ using System.IO; using System.Drawing; using System.Drawing.Imaging; using System.Linq; -using System.Runtime.InteropServices;
+using System.Runtime.InteropServices; using System.Collections.Generic; using Microsoft.Win32; -using CustomControls.OS;
+using CustomControls.OS; using MonoDevelop.Ide.Desktop; using System.Diagnostics; using MonoDevelop.Core.Execution; using System.Text; using MonoDevelop.Core; using Microsoft.WindowsAPICodePack.Taskbar; -using MonoDevelop.Ide;
-
+using MonoDevelop.Ide; + namespace MonoDevelop.Platform { public class WindowsPlatform : PlatformService @@ -344,7 +344,7 @@ namespace MonoDevelop.Platform //first check for the user's preferred app for this file type and use it as the default using (var key = Registry.CurrentUser.OpenSubKey (@"Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\" + extension + @"\UserChoice")) { - var progid = key == null ? null : key.GetValue ("ProgId") as string; + var progid = key?.GetValue ("ProgId") as string; if (progid != null) apps[progid] = defaultApp = WindowsAppFromName (progid, true, AssociationFlags.None); } |