Merge branch 'master' of https://github.com/HandyOrg/HandyControl
This commit is contained in:
commit
1ab1aae4de
23 files changed
+220
-220
No files matched your search
@@ -250,7 +250,7 @@ namespace Microsoft.Windows.Shell
|
|||||||
}
|
}
|
||||||
Guid guid = new Guid("92CA9DCD-5622-4bba-A805-5E9F541BD8C9");
|
Guid guid = new Guid("92CA9DCD-5622-4bba-A805-5E9F541BD8C9");
|
||||||
uint num;
|
uint num;
|
||||||
IObjectArray shellObjects = (IObjectArray)customDestinationList.BeginList(out num, ref guid);
|
IObjectArray shellObjects = (IObjectArray) customDestinationList.BeginList(out num, ref guid);
|
||||||
removedList = JumpList.GenerateJumpItems(shellObjects);
|
removedList = JumpList.GenerateJumpItems(shellObjects);
|
||||||
successList = new List<JumpItem>(this.JumpItems.Count);
|
successList = new List<JumpItem>(this.JumpItems.Count);
|
||||||
rejectedList = new List<JumpList._RejectedJumpItemPair>(this.JumpItems.Count);
|
rejectedList = new List<JumpList._RejectedJumpItemPair>(this.JumpItems.Count);
|
||||||
@@ -376,7 +376,7 @@ namespace Microsoft.Windows.Shell
|
|||||||
foreach (JumpList._ShellObjectPair shellObjectPair in removedList)
|
foreach (JumpList._ShellObjectPair shellObjectPair in removedList)
|
||||||
{
|
{
|
||||||
IShellItem shellItem2 = shellObjectPair.ShellObject as IShellItem;
|
IShellItem shellItem2 = shellObjectPair.ShellObject as IShellItem;
|
||||||
if (shellItem2 != null && shellItem.Compare(shellItem2, (SICHINT)805306368u) == 0)
|
if (shellItem2 != null && shellItem.Compare(shellItem2, (SICHINT) 805306368u) == 0)
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@@ -455,7 +455,7 @@ namespace Microsoft.Windows.Shell
|
|||||||
|
|
||||||
private static void AddCategory(ICustomDestinationList cdl, string category, List<JumpList._ShellObjectPair> jumpItems, List<JumpItem> successList, List<JumpList._RejectedJumpItemPair> rejectionList, bool isHeterogenous)
|
private static void AddCategory(ICustomDestinationList cdl, string category, List<JumpList._ShellObjectPair> jumpItems, List<JumpItem> successList, List<JumpList._RejectedJumpItemPair> rejectionList, bool isHeterogenous)
|
||||||
{
|
{
|
||||||
IObjectCollection objectCollection = (IObjectCollection)Activator.CreateInstance(Type.GetTypeFromCLSID(new Guid("2d3468c1-36a7-43b6-ac24-d3f02fd9607a")));
|
IObjectCollection objectCollection = (IObjectCollection) Activator.CreateInstance(Type.GetTypeFromCLSID(new Guid("2d3468c1-36a7-43b6-ac24-d3f02fd9607a")));
|
||||||
foreach (JumpList._ShellObjectPair shellObjectPair in jumpItems)
|
foreach (JumpList._ShellObjectPair shellObjectPair in jumpItems)
|
||||||
{
|
{
|
||||||
objectCollection.AddObject(shellObjectPair.ShellObject);
|
objectCollection.AddObject(shellObjectPair.ShellObject);
|
||||||
@@ -523,7 +523,7 @@ namespace Microsoft.Windows.Shell
|
|||||||
{
|
{
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
IShellLinkW shellLinkW = (IShellLinkW)Activator.CreateInstance(Type.GetTypeFromCLSID(new Guid("00021401-0000-0000-C000-000000000046")));
|
IShellLinkW shellLinkW = (IShellLinkW) Activator.CreateInstance(Type.GetTypeFromCLSID(new Guid("00021401-0000-0000-C000-000000000046")));
|
||||||
IShellLinkW result;
|
IShellLinkW result;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
@@ -546,7 +546,7 @@ namespace Microsoft.Windows.Shell
|
|||||||
string pszIconPath = JumpList._FullName;
|
string pszIconPath = JumpList._FullName;
|
||||||
if (!string.IsNullOrEmpty(jumpTask.IconResourcePath))
|
if (!string.IsNullOrEmpty(jumpTask.IconResourcePath))
|
||||||
{
|
{
|
||||||
if ((long)jumpTask.IconResourcePath.Length >= 260L)
|
if ((long) jumpTask.IconResourcePath.Length >= 260L)
|
||||||
{
|
{
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
@@ -558,7 +558,7 @@ namespace Microsoft.Windows.Shell
|
|||||||
{
|
{
|
||||||
shellLinkW.SetDescription(jumpTask.Description);
|
shellLinkW.SetDescription(jumpTask.Description);
|
||||||
}
|
}
|
||||||
IPropertyStore propertyStore = (IPropertyStore)shellLinkW;
|
IPropertyStore propertyStore = (IPropertyStore) shellLinkW;
|
||||||
using (PROPVARIANT propvariant = new PROPVARIANT())
|
using (PROPVARIANT propvariant = new PROPVARIANT())
|
||||||
{
|
{
|
||||||
PKEY pkey = default(PKEY);
|
PKEY pkey = default(PKEY);
|
||||||
@@ -599,13 +599,13 @@ namespace Microsoft.Windows.Shell
|
|||||||
Guid guid = new Guid("7e9fb0d3-919f-4307-ab2e-9b1860310c93");
|
Guid guid = new Guid("7e9fb0d3-919f-4307-ab2e-9b1860310c93");
|
||||||
object obj;
|
object obj;
|
||||||
HRESULT hrLeft = NativeMethods.SHCreateItemFromParsingName(path, null, ref guid, out obj);
|
HRESULT hrLeft = NativeMethods.SHCreateItemFromParsingName(path, null, ref guid, out obj);
|
||||||
if (hrLeft == (HRESULT)Win32Error.ERROR_FILE_NOT_FOUND || hrLeft == (HRESULT)Win32Error.ERROR_PATH_NOT_FOUND)
|
if (hrLeft == (HRESULT) Win32Error.ERROR_FILE_NOT_FOUND || hrLeft == (HRESULT) Win32Error.ERROR_PATH_NOT_FOUND)
|
||||||
{
|
{
|
||||||
hrLeft = HRESULT.S_OK;
|
hrLeft = HRESULT.S_OK;
|
||||||
obj = null;
|
obj = null;
|
||||||
}
|
}
|
||||||
hrLeft.ThrowIfFailed();
|
hrLeft.ThrowIfFailed();
|
||||||
return (IShellItem2)obj;
|
return (IShellItem2) obj;
|
||||||
}
|
}
|
||||||
|
|
||||||
[SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes")]
|
[SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes")]
|
||||||
@@ -629,7 +629,7 @@ namespace Microsoft.Windows.Shell
|
|||||||
{
|
{
|
||||||
return new JumpPath
|
return new JumpPath
|
||||||
{
|
{
|
||||||
Path = shellItem.GetDisplayName((SIGDN)2147647488u)
|
Path = shellItem.GetDisplayName((SIGDN) 2147647488u)
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
if (shellLinkW != null)
|
if (shellLinkW != null)
|
||||||
@@ -656,7 +656,7 @@ namespace Microsoft.Windows.Shell
|
|||||||
};
|
};
|
||||||
using (PROPVARIANT propvariant = new PROPVARIANT())
|
using (PROPVARIANT propvariant = new PROPVARIANT())
|
||||||
{
|
{
|
||||||
IPropertyStore propertyStore = (IPropertyStore)shellLinkW;
|
IPropertyStore propertyStore = (IPropertyStore) shellLinkW;
|
||||||
PKEY title = PKEY.Title;
|
PKEY title = PKEY.Title;
|
||||||
propertyStore.GetValue(ref title, propvariant);
|
propertyStore.GetValue(ref title, propvariant);
|
||||||
jumpTask.Title = (propvariant.GetValue() ?? "");
|
jumpTask.Title = (propvariant.GetValue() ?? "");
|
||||||
@@ -673,7 +673,7 @@ namespace Microsoft.Windows.Shell
|
|||||||
string text = null;
|
string text = null;
|
||||||
using (PROPVARIANT propvariant = new PROPVARIANT())
|
using (PROPVARIANT propvariant = new PROPVARIANT())
|
||||||
{
|
{
|
||||||
IPropertyStore propertyStore = (IPropertyStore)shellLink;
|
IPropertyStore propertyStore = (IPropertyStore) shellLink;
|
||||||
PKEY title = PKEY.Title;
|
PKEY title = PKEY.Title;
|
||||||
propertyStore.GetValue(ref title, propvariant);
|
propertyStore.GetValue(ref title, propvariant);
|
||||||
text = (propvariant.GetValue() ?? "");
|
text = (propvariant.GetValue() ?? "");
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ namespace Standard
|
|||||||
{
|
{
|
||||||
public static T CoCreateInstance<T>(string clsid)
|
public static T CoCreateInstance<T>(string clsid)
|
||||||
{
|
{
|
||||||
return (T)((object)Activator.CreateInstance(Type.GetTypeFromCLSID(new Guid(clsid))));
|
return (T) ((object) Activator.CreateInstance(Type.GetTypeFromCLSID(new Guid(clsid))));
|
||||||
}
|
}
|
||||||
|
|
||||||
public const string TaskbarList = "56FDF344-FD6D-11d0-958A-006097C9A090";
|
public const string TaskbarList = "56FDF344-FD6D-11d0-958A-006097C9A090";
|
||||||
|
|||||||
@@ -15,9 +15,9 @@ namespace Standard
|
|||||||
int deviceCaps = NativeMethods.GetDeviceCaps(desktop, DeviceCap.LOGPIXELSX);
|
int deviceCaps = NativeMethods.GetDeviceCaps(desktop, DeviceCap.LOGPIXELSX);
|
||||||
int deviceCaps2 = NativeMethods.GetDeviceCaps(desktop, DeviceCap.LOGPIXELSY);
|
int deviceCaps2 = NativeMethods.GetDeviceCaps(desktop, DeviceCap.LOGPIXELSY);
|
||||||
DpiHelper._transformToDip = Matrix.Identity;
|
DpiHelper._transformToDip = Matrix.Identity;
|
||||||
DpiHelper._transformToDip.Scale(96.0 / (double)deviceCaps, 96.0 / (double)deviceCaps2);
|
DpiHelper._transformToDip.Scale(96.0 / (double) deviceCaps, 96.0 / (double) deviceCaps2);
|
||||||
DpiHelper._transformToDevice = Matrix.Identity;
|
DpiHelper._transformToDevice = Matrix.Identity;
|
||||||
DpiHelper._transformToDevice.Scale((double)deviceCaps / 96.0, (double)deviceCaps2 / 96.0);
|
DpiHelper._transformToDevice.Scale((double) deviceCaps / 96.0, (double) deviceCaps2 / 96.0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -17,27 +17,27 @@ namespace Standard
|
|||||||
|
|
||||||
public static HRESULT Make(bool severe, Facility facility, int code)
|
public static HRESULT Make(bool severe, Facility facility, int code)
|
||||||
{
|
{
|
||||||
return new HRESULT((uint)((severe ? (Facility)(-2147483648) : Facility.Null) | (Facility) ((int)facility << 16) | (Facility)code));
|
return new HRESULT((uint) ((severe ? (Facility) (-2147483648) : Facility.Null) | (Facility) ((int) facility << 16) | (Facility) code));
|
||||||
}
|
}
|
||||||
|
|
||||||
public Facility Facility
|
public Facility Facility
|
||||||
{
|
{
|
||||||
get
|
get
|
||||||
{
|
{
|
||||||
return HRESULT.GetFacility((int)this._value);
|
return HRESULT.GetFacility((int) this._value);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Facility GetFacility(int errorCode)
|
public static Facility GetFacility(int errorCode)
|
||||||
{
|
{
|
||||||
return (Facility)(errorCode >> 16 & 8191);
|
return (Facility) (errorCode >> 16 & 8191);
|
||||||
}
|
}
|
||||||
|
|
||||||
public int Code
|
public int Code
|
||||||
{
|
{
|
||||||
get
|
get
|
||||||
{
|
{
|
||||||
return HRESULT.GetCode((int)this._value);
|
return HRESULT.GetCode((int) this._value);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -52,7 +52,7 @@ namespace Standard
|
|||||||
{
|
{
|
||||||
if (fieldInfo.FieldType == typeof(HRESULT))
|
if (fieldInfo.FieldType == typeof(HRESULT))
|
||||||
{
|
{
|
||||||
HRESULT hrLeft = (HRESULT)fieldInfo.GetValue(null);
|
HRESULT hrLeft = (HRESULT) fieldInfo.GetValue(null);
|
||||||
if (hrLeft == this)
|
if (hrLeft == this)
|
||||||
{
|
{
|
||||||
return fieldInfo.Name;
|
return fieldInfo.Name;
|
||||||
@@ -65,8 +65,8 @@ namespace Standard
|
|||||||
{
|
{
|
||||||
if (fieldInfo2.FieldType == typeof(Win32Error))
|
if (fieldInfo2.FieldType == typeof(Win32Error))
|
||||||
{
|
{
|
||||||
Win32Error error = (Win32Error)fieldInfo2.GetValue(null);
|
Win32Error error = (Win32Error) fieldInfo2.GetValue(null);
|
||||||
if ((HRESULT)error == this)
|
if ((HRESULT) error == this)
|
||||||
{
|
{
|
||||||
return "HRESULT_FROM_WIN32(" + fieldInfo2.Name + ")";
|
return "HRESULT_FROM_WIN32(" + fieldInfo2.Name + ")";
|
||||||
}
|
}
|
||||||
@@ -84,7 +84,7 @@ namespace Standard
|
|||||||
bool result;
|
bool result;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
result = (((HRESULT)obj)._value == this._value);
|
result = (((HRESULT) obj)._value == this._value);
|
||||||
}
|
}
|
||||||
catch (InvalidCastException)
|
catch (InvalidCastException)
|
||||||
{
|
{
|
||||||
@@ -139,7 +139,7 @@ namespace Standard
|
|||||||
{
|
{
|
||||||
message = this.ToString();
|
message = this.ToString();
|
||||||
}
|
}
|
||||||
Exception ex = Marshal.GetExceptionForHR((int)this._value, new IntPtr(-1));
|
Exception ex = Marshal.GetExceptionForHR((int) this._value, new IntPtr(-1));
|
||||||
if (ex.GetType() == typeof(COMException))
|
if (ex.GetType() == typeof(COMException))
|
||||||
{
|
{
|
||||||
Facility facility = this.Facility;
|
Facility facility = this.Facility;
|
||||||
@@ -149,7 +149,7 @@ namespace Standard
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
ex = new COMException(message, (int)this._value);
|
ex = new COMException(message, (int) this._value);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -172,7 +172,7 @@ namespace Standard
|
|||||||
|
|
||||||
public static void ThrowLastError()
|
public static void ThrowLastError()
|
||||||
{
|
{
|
||||||
((HRESULT)Win32Error.GetLastError()).ThrowIfFailed();
|
((HRESULT) Win32Error.GetLastError()).ThrowIfFailed();
|
||||||
}
|
}
|
||||||
|
|
||||||
[FieldOffset(0)]
|
[FieldOffset(0)]
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ namespace Standard
|
|||||||
[ComImport]
|
[ComImport]
|
||||||
internal interface IApplicationDestinations
|
internal interface IApplicationDestinations
|
||||||
{
|
{
|
||||||
void SetAppID([MarshalAs(UnmanagedType.LPWStr)] [In] string pszAppID);
|
void SetAppID([MarshalAs(UnmanagedType.LPWStr)][In] string pszAppID);
|
||||||
|
|
||||||
void RemoveDestination([MarshalAs(UnmanagedType.IUnknown)] object punk);
|
void RemoveDestination([MarshalAs(UnmanagedType.IUnknown)] object punk);
|
||||||
|
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ namespace Standard
|
|||||||
[ComImport]
|
[ComImport]
|
||||||
internal interface ICustomDestinationList
|
internal interface ICustomDestinationList
|
||||||
{
|
{
|
||||||
void SetAppID([MarshalAs(UnmanagedType.LPWStr)] [In] string pszAppID);
|
void SetAppID([MarshalAs(UnmanagedType.LPWStr)][In] string pszAppID);
|
||||||
|
|
||||||
[return: MarshalAs(UnmanagedType.Interface)]
|
[return: MarshalAs(UnmanagedType.Interface)]
|
||||||
object BeginList(out uint pcMaxSlots, [In] ref Guid riid);
|
object BeginList(out uint pcMaxSlots, [In] ref Guid riid);
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ namespace Standard
|
|||||||
[ComImport]
|
[ComImport]
|
||||||
internal interface IEnumObjects
|
internal interface IEnumObjects
|
||||||
{
|
{
|
||||||
void Next(uint celt, [In] ref Guid riid, [MarshalAs(UnmanagedType.LPArray, ArraySubType = UnmanagedType.IUnknown, SizeParamIndex = 0)] [Out] object[] rgelt, out uint pceltFetched);
|
void Next(uint celt, [In] ref Guid riid, [MarshalAs(UnmanagedType.LPArray, ArraySubType = UnmanagedType.IUnknown, SizeParamIndex = 0)][Out] object[] rgelt, out uint pceltFetched);
|
||||||
|
|
||||||
void Skip(uint celt);
|
void Skip(uint celt);
|
||||||
|
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ namespace Standard
|
|||||||
|
|
||||||
PKEY GetAt(uint iProp);
|
PKEY GetAt(uint iProp);
|
||||||
|
|
||||||
void GetValue([In] ref PKEY pkey, [In] [Out] PROPVARIANT pv);
|
void GetValue([In] ref PKEY pkey, [In][Out] PROPVARIANT pv);
|
||||||
|
|
||||||
void SetValue([In] ref PKEY pkey, PROPVARIANT pv);
|
void SetValue([In] ref PKEY pkey, PROPVARIANT pv);
|
||||||
|
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ namespace Standard
|
|||||||
[ComImport]
|
[ComImport]
|
||||||
internal interface IShellFolder
|
internal interface IShellFolder
|
||||||
{
|
{
|
||||||
void ParseDisplayName([In] IntPtr hwnd, [In] IBindCtx pbc, [MarshalAs(UnmanagedType.LPWStr)] [In] string pszDisplayName, [In] [Out] ref int pchEaten, out IntPtr ppidl, [In] [Out] ref uint pdwAttributes);
|
void ParseDisplayName([In] IntPtr hwnd, [In] IBindCtx pbc, [MarshalAs(UnmanagedType.LPWStr)][In] string pszDisplayName, [In][Out] ref int pchEaten, out IntPtr ppidl, [In][Out] ref uint pdwAttributes);
|
||||||
|
|
||||||
IEnumIDList EnumObjects([In] IntPtr hwnd, [In] SHCONTF grfFlags);
|
IEnumIDList EnumObjects([In] IntPtr hwnd, [In] SHCONTF grfFlags);
|
||||||
|
|
||||||
@@ -25,13 +25,13 @@ namespace Standard
|
|||||||
[return: MarshalAs(UnmanagedType.Interface)]
|
[return: MarshalAs(UnmanagedType.Interface)]
|
||||||
object CreateViewObject([In] IntPtr hwndOwner, [In] ref Guid riid);
|
object CreateViewObject([In] IntPtr hwndOwner, [In] ref Guid riid);
|
||||||
|
|
||||||
void GetAttributesOf([In] uint cidl, [In] IntPtr apidl, [In] [Out] ref SFGAO rgfInOut);
|
void GetAttributesOf([In] uint cidl, [In] IntPtr apidl, [In][Out] ref SFGAO rgfInOut);
|
||||||
|
|
||||||
[return: MarshalAs(UnmanagedType.Interface)]
|
[return: MarshalAs(UnmanagedType.Interface)]
|
||||||
object GetUIObjectOf([In] IntPtr hwndOwner, [In] uint cidl, [MarshalAs(UnmanagedType.LPArray, ArraySubType = UnmanagedType.SysInt, SizeParamIndex = 2)] [In] IntPtr apidl, [In] ref Guid riid, [In] [Out] ref uint rgfReserved);
|
object GetUIObjectOf([In] IntPtr hwndOwner, [In] uint cidl, [MarshalAs(UnmanagedType.LPArray, ArraySubType = UnmanagedType.SysInt, SizeParamIndex = 2)][In] IntPtr apidl, [In] ref Guid riid, [In][Out] ref uint rgfReserved);
|
||||||
|
|
||||||
void GetDisplayNameOf([In] IntPtr pidl, [In] SHGDN uFlags, out IntPtr pName);
|
void GetDisplayNameOf([In] IntPtr pidl, [In] SHGDN uFlags, out IntPtr pName);
|
||||||
|
|
||||||
void SetNameOf([In] IntPtr hwnd, [In] IntPtr pidl, [MarshalAs(UnmanagedType.LPWStr)] [In] string pszName, [In] SHGDN uFlags, out IntPtr ppidlOut);
|
void SetNameOf([In] IntPtr hwnd, [In] IntPtr pidl, [MarshalAs(UnmanagedType.LPWStr)][In] string pszName, [In] SHGDN uFlags, out IntPtr ppidlOut);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -9,21 +9,21 @@ namespace Standard
|
|||||||
[ComImport]
|
[ComImport]
|
||||||
internal interface IShellLinkW
|
internal interface IShellLinkW
|
||||||
{
|
{
|
||||||
void GetPath([MarshalAs(UnmanagedType.LPWStr)] [Out] StringBuilder pszFile, int cchMaxPath, [In] [Out] WIN32_FIND_DATAW pfd, SLGP fFlags);
|
void GetPath([MarshalAs(UnmanagedType.LPWStr)][Out] StringBuilder pszFile, int cchMaxPath, [In][Out] WIN32_FIND_DATAW pfd, SLGP fFlags);
|
||||||
|
|
||||||
void GetIDList(out IntPtr ppidl);
|
void GetIDList(out IntPtr ppidl);
|
||||||
|
|
||||||
void SetIDList(IntPtr pidl);
|
void SetIDList(IntPtr pidl);
|
||||||
|
|
||||||
void GetDescription([MarshalAs(UnmanagedType.LPWStr)] [Out] StringBuilder pszFile, int cchMaxName);
|
void GetDescription([MarshalAs(UnmanagedType.LPWStr)][Out] StringBuilder pszFile, int cchMaxName);
|
||||||
|
|
||||||
void SetDescription([MarshalAs(UnmanagedType.LPWStr)] string pszName);
|
void SetDescription([MarshalAs(UnmanagedType.LPWStr)] string pszName);
|
||||||
|
|
||||||
void GetWorkingDirectory([MarshalAs(UnmanagedType.LPWStr)] [Out] StringBuilder pszDir, int cchMaxPath);
|
void GetWorkingDirectory([MarshalAs(UnmanagedType.LPWStr)][Out] StringBuilder pszDir, int cchMaxPath);
|
||||||
|
|
||||||
void SetWorkingDirectory([MarshalAs(UnmanagedType.LPWStr)] string pszDir);
|
void SetWorkingDirectory([MarshalAs(UnmanagedType.LPWStr)] string pszDir);
|
||||||
|
|
||||||
void GetArguments([MarshalAs(UnmanagedType.LPWStr)] [Out] StringBuilder pszArgs, int cchMaxPath);
|
void GetArguments([MarshalAs(UnmanagedType.LPWStr)][Out] StringBuilder pszArgs, int cchMaxPath);
|
||||||
|
|
||||||
void SetArguments([MarshalAs(UnmanagedType.LPWStr)] string pszArgs);
|
void SetArguments([MarshalAs(UnmanagedType.LPWStr)] string pszArgs);
|
||||||
|
|
||||||
@@ -35,7 +35,7 @@ namespace Standard
|
|||||||
|
|
||||||
void SetShowCmd(uint iShowCmd);
|
void SetShowCmd(uint iShowCmd);
|
||||||
|
|
||||||
void GetIconLocation([MarshalAs(UnmanagedType.LPWStr)] [Out] StringBuilder pszIconPath, int cchIconPath, out int piIcon);
|
void GetIconLocation([MarshalAs(UnmanagedType.LPWStr)][Out] StringBuilder pszIconPath, int cchIconPath, out int piIcon);
|
||||||
|
|
||||||
void SetIconLocation([MarshalAs(UnmanagedType.LPWStr)] string pszIconPath, int iIcon);
|
void SetIconLocation([MarshalAs(UnmanagedType.LPWStr)] string pszIconPath, int iIcon);
|
||||||
|
|
||||||
|
|||||||
@@ -45,7 +45,7 @@ namespace Standard
|
|||||||
byte[] array = new byte[4096];
|
byte[] array = new byte[4096];
|
||||||
long num;
|
long num;
|
||||||
int num2;
|
int num2;
|
||||||
for (num = 0L; num < cb; num += (long)num2)
|
for (num = 0L; num < cb; num += (long) num2)
|
||||||
{
|
{
|
||||||
num2 = this._source.Read(array, 0, array.Length);
|
num2 = this._source.Read(array, 0, array.Length);
|
||||||
if (num2 == 0)
|
if (num2 == 0)
|
||||||
@@ -93,7 +93,7 @@ namespace Standard
|
|||||||
public void Seek(long dlibMove, int dwOrigin, IntPtr plibNewPosition)
|
public void Seek(long dlibMove, int dwOrigin, IntPtr plibNewPosition)
|
||||||
{
|
{
|
||||||
this._Validate();
|
this._Validate();
|
||||||
long val = this._source.Seek(dlibMove, (SeekOrigin)dwOrigin);
|
long val = this._source.Seek(dlibMove, (SeekOrigin) dwOrigin);
|
||||||
if (IntPtr.Zero != plibNewPosition)
|
if (IntPtr.Zero != plibNewPosition)
|
||||||
{
|
{
|
||||||
Marshal.WriteInt64(plibNewPosition, val);
|
Marshal.WriteInt64(plibNewPosition, val);
|
||||||
|
|||||||
@@ -31,8 +31,8 @@ namespace Standard
|
|||||||
try
|
try
|
||||||
{
|
{
|
||||||
value = GCHandle.Alloc(this);
|
value = GCHandle.Alloc(this);
|
||||||
IntPtr lpParam = (IntPtr)value;
|
IntPtr lpParam = (IntPtr) value;
|
||||||
this.Handle = NativeMethods.CreateWindowEx(exStyle, this._className, name, style, (int)location.X, (int)location.Y, (int)location.Width, (int)location.Height, IntPtr.Zero, IntPtr.Zero, IntPtr.Zero, lpParam);
|
this.Handle = NativeMethods.CreateWindowEx(exStyle, this._className, name, style, (int) location.X, (int) location.Y, (int) location.Width, (int) location.Height, IntPtr.Zero, IntPtr.Zero, IntPtr.Zero, lpParam);
|
||||||
}
|
}
|
||||||
finally
|
finally
|
||||||
{
|
{
|
||||||
@@ -88,7 +88,7 @@ namespace Standard
|
|||||||
MessageWindow messageWindow = null;
|
MessageWindow messageWindow = null;
|
||||||
if (msg == WM.CREATE)
|
if (msg == WM.CREATE)
|
||||||
{
|
{
|
||||||
messageWindow = (MessageWindow)GCHandle.FromIntPtr(((CREATESTRUCT)Marshal.PtrToStructure(lParam, typeof(CREATESTRUCT))).lpCreateParams).Target;
|
messageWindow = (MessageWindow) GCHandle.FromIntPtr(((CREATESTRUCT) Marshal.PtrToStructure(lParam, typeof(CREATESTRUCT))).lpCreateParams).Target;
|
||||||
MessageWindow.s_windowLookup.Add(hwnd, messageWindow);
|
MessageWindow.s_windowLookup.Add(hwnd, messageWindow);
|
||||||
}
|
}
|
||||||
else if (!MessageWindow.s_windowLookup.TryGetValue(hwnd, out messageWindow))
|
else if (!MessageWindow.s_windowLookup.TryGetValue(hwnd, out messageWindow))
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ namespace Standard
|
|||||||
[SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
|
[SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
|
||||||
[DllImport("user32.dll", EntryPoint = "ChangeWindowMessageFilterEx", SetLastError = true)]
|
[DllImport("user32.dll", EntryPoint = "ChangeWindowMessageFilterEx", SetLastError = true)]
|
||||||
[return: MarshalAs(UnmanagedType.Bool)]
|
[return: MarshalAs(UnmanagedType.Bool)]
|
||||||
private static extern bool _ChangeWindowMessageFilterEx(IntPtr hwnd, WM message, MSGFLT action, [In] [Out] ref CHANGEFILTERSTRUCT pChangeFilterStruct);
|
private static extern bool _ChangeWindowMessageFilterEx(IntPtr hwnd, WM message, MSGFLT action, [In][Out] ref CHANGEFILTERSTRUCT pChangeFilterStruct);
|
||||||
|
|
||||||
[SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
|
[SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
|
||||||
public static HRESULT ChangeWindowMessageFilterEx(IntPtr hwnd, WM message, MSGFLT action, out MSGFLTINFO filterInfo)
|
public static HRESULT ChangeWindowMessageFilterEx(IntPtr hwnd, WM message, MSGFLT action, out MSGFLTINFO filterInfo)
|
||||||
@@ -46,7 +46,7 @@ namespace Standard
|
|||||||
{
|
{
|
||||||
if (!NativeMethods._ChangeWindowMessageFilter(message, action))
|
if (!NativeMethods._ChangeWindowMessageFilter(message, action))
|
||||||
{
|
{
|
||||||
return (HRESULT)Win32Error.GetLastError();
|
return (HRESULT) Win32Error.GetLastError();
|
||||||
}
|
}
|
||||||
return HRESULT.S_OK;
|
return HRESULT.S_OK;
|
||||||
}
|
}
|
||||||
@@ -54,11 +54,11 @@ namespace Standard
|
|||||||
{
|
{
|
||||||
CHANGEFILTERSTRUCT changefilterstruct = new CHANGEFILTERSTRUCT
|
CHANGEFILTERSTRUCT changefilterstruct = new CHANGEFILTERSTRUCT
|
||||||
{
|
{
|
||||||
cbSize = (uint)Marshal.SizeOf(typeof(CHANGEFILTERSTRUCT))
|
cbSize = (uint) Marshal.SizeOf(typeof(CHANGEFILTERSTRUCT))
|
||||||
};
|
};
|
||||||
if (!NativeMethods._ChangeWindowMessageFilterEx(hwnd, message, action, ref changefilterstruct))
|
if (!NativeMethods._ChangeWindowMessageFilterEx(hwnd, message, action, ref changefilterstruct))
|
||||||
{
|
{
|
||||||
return (HRESULT)Win32Error.GetLastError();
|
return (HRESULT) Win32Error.GetLastError();
|
||||||
}
|
}
|
||||||
filterInfo = changefilterstruct.ExtStatus;
|
filterInfo = changefilterstruct.ExtStatus;
|
||||||
return HRESULT.S_OK;
|
return HRESULT.S_OK;
|
||||||
@@ -258,7 +258,7 @@ namespace Standard
|
|||||||
[SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
|
[SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
|
||||||
public static void DwmSetWindowAttributeFlip3DPolicy(IntPtr hwnd, DWMFLIP3D flip3dPolicy)
|
public static void DwmSetWindowAttributeFlip3DPolicy(IntPtr hwnd, DWMFLIP3D flip3dPolicy)
|
||||||
{
|
{
|
||||||
int num = (int)flip3dPolicy;
|
int num = (int) flip3dPolicy;
|
||||||
NativeMethods._DwmSetWindowAttribute(hwnd, DWMWA.FLIP3D_POLICY, ref num, 4);
|
NativeMethods._DwmSetWindowAttribute(hwnd, DWMWA.FLIP3D_POLICY, ref num, 4);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -276,7 +276,7 @@ namespace Standard
|
|||||||
[SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
|
[SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
|
||||||
public static MF EnableMenuItem(IntPtr hMenu, SC uIDEnableItem, MF uEnable)
|
public static MF EnableMenuItem(IntPtr hMenu, SC uIDEnableItem, MF uEnable)
|
||||||
{
|
{
|
||||||
return (MF)NativeMethods._EnableMenuItem(hMenu, uIDEnableItem, uEnable);
|
return (MF) NativeMethods._EnableMenuItem(hMenu, uIDEnableItem, uEnable);
|
||||||
}
|
}
|
||||||
|
|
||||||
[SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
|
[SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
|
||||||
@@ -287,7 +287,7 @@ namespace Standard
|
|||||||
[SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
|
[SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
|
||||||
public static void RemoveMenu(IntPtr hMenu, SC uPosition, MF uFlags)
|
public static void RemoveMenu(IntPtr hMenu, SC uPosition, MF uFlags)
|
||||||
{
|
{
|
||||||
if (!NativeMethods._RemoveMenu(hMenu, (uint)uPosition, (uint)uFlags))
|
if (!NativeMethods._RemoveMenu(hMenu, (uint) uPosition, (uint) uFlags))
|
||||||
{
|
{
|
||||||
throw new Win32Exception();
|
throw new Win32Exception();
|
||||||
}
|
}
|
||||||
@@ -315,12 +315,12 @@ namespace Standard
|
|||||||
|
|
||||||
[SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
|
[SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
|
||||||
[DllImport("kernel32.dll", CharSet = CharSet.Unicode, SetLastError = true)]
|
[DllImport("kernel32.dll", CharSet = CharSet.Unicode, SetLastError = true)]
|
||||||
public static extern SafeFindHandle FindFirstFileW(string lpFileName, [MarshalAs(UnmanagedType.LPStruct)] [In] [Out] WIN32_FIND_DATAW lpFindFileData);
|
public static extern SafeFindHandle FindFirstFileW(string lpFileName, [MarshalAs(UnmanagedType.LPStruct)][In][Out] WIN32_FIND_DATAW lpFindFileData);
|
||||||
|
|
||||||
[SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
|
[SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
|
||||||
[DllImport("kernel32.dll", SetLastError = true)]
|
[DllImport("kernel32.dll", SetLastError = true)]
|
||||||
[return: MarshalAs(UnmanagedType.Bool)]
|
[return: MarshalAs(UnmanagedType.Bool)]
|
||||||
public static extern bool FindNextFileW(SafeFindHandle hndFindFile, [MarshalAs(UnmanagedType.LPStruct)] [In] [Out] WIN32_FIND_DATAW lpFindFileData);
|
public static extern bool FindNextFileW(SafeFindHandle hndFindFile, [MarshalAs(UnmanagedType.LPStruct)][In][Out] WIN32_FIND_DATAW lpFindFileData);
|
||||||
|
|
||||||
[SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
|
[SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
|
||||||
[DllImport("user32.dll", EntryPoint = "GetClientRect", SetLastError = true)]
|
[DllImport("user32.dll", EntryPoint = "GetClientRect", SetLastError = true)]
|
||||||
@@ -374,7 +374,7 @@ namespace Standard
|
|||||||
public static string GetModuleFileName(IntPtr hModule)
|
public static string GetModuleFileName(IntPtr hModule)
|
||||||
{
|
{
|
||||||
StringBuilder stringBuilder = new StringBuilder(260);
|
StringBuilder stringBuilder = new StringBuilder(260);
|
||||||
for (;;)
|
for (; ; )
|
||||||
{
|
{
|
||||||
int num = NativeMethods._GetModuleFileName(hModule, stringBuilder, stringBuilder.Capacity);
|
int num = NativeMethods._GetModuleFileName(hModule, stringBuilder, stringBuilder.Capacity);
|
||||||
if (num == 0)
|
if (num == 0)
|
||||||
@@ -406,7 +406,7 @@ namespace Standard
|
|||||||
[SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
|
[SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
|
||||||
[DllImport("user32.dll", EntryPoint = "GetMonitorInfo", SetLastError = true)]
|
[DllImport("user32.dll", EntryPoint = "GetMonitorInfo", SetLastError = true)]
|
||||||
[return: MarshalAs(UnmanagedType.Bool)]
|
[return: MarshalAs(UnmanagedType.Bool)]
|
||||||
private static extern bool _GetMonitorInfo(IntPtr hMonitor, [In] [Out] MONITORINFO lpmi);
|
private static extern bool _GetMonitorInfo(IntPtr hMonitor, [In][Out] MONITORINFO lpmi);
|
||||||
|
|
||||||
[SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
|
[SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
|
||||||
public static MONITORINFO GetMonitorInfo(IntPtr hMonitor)
|
public static MONITORINFO GetMonitorInfo(IntPtr hMonitor)
|
||||||
@@ -581,7 +581,7 @@ namespace Standard
|
|||||||
{
|
{
|
||||||
HRESULT.ThrowLastError();
|
HRESULT.ThrowLastError();
|
||||||
}
|
}
|
||||||
return (WM)num;
|
return (WM) num;
|
||||||
}
|
}
|
||||||
|
|
||||||
[SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
|
[SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
|
||||||
@@ -698,12 +698,12 @@ namespace Standard
|
|||||||
[SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
|
[SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
|
||||||
[DllImport("user32.dll", CharSet = CharSet.Unicode, EntryPoint = "SystemParametersInfoW", SetLastError = true)]
|
[DllImport("user32.dll", CharSet = CharSet.Unicode, EntryPoint = "SystemParametersInfoW", SetLastError = true)]
|
||||||
[return: MarshalAs(UnmanagedType.Bool)]
|
[return: MarshalAs(UnmanagedType.Bool)]
|
||||||
private static extern bool _SystemParametersInfo_NONCLIENTMETRICS(SPI uiAction, int uiParam, [In] [Out] ref NONCLIENTMETRICS pvParam, SPIF fWinIni);
|
private static extern bool _SystemParametersInfo_NONCLIENTMETRICS(SPI uiAction, int uiParam, [In][Out] ref NONCLIENTMETRICS pvParam, SPIF fWinIni);
|
||||||
|
|
||||||
[SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
|
[SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
|
||||||
[DllImport("user32.dll", CharSet = CharSet.Unicode, EntryPoint = "SystemParametersInfoW", SetLastError = true)]
|
[DllImport("user32.dll", CharSet = CharSet.Unicode, EntryPoint = "SystemParametersInfoW", SetLastError = true)]
|
||||||
[return: MarshalAs(UnmanagedType.Bool)]
|
[return: MarshalAs(UnmanagedType.Bool)]
|
||||||
private static extern bool _SystemParametersInfo_HIGHCONTRAST(SPI uiAction, int uiParam, [In] [Out] ref HIGHCONTRAST pvParam, SPIF fWinIni);
|
private static extern bool _SystemParametersInfo_HIGHCONTRAST(SPI uiAction, int uiParam, [In][Out] ref HIGHCONTRAST pvParam, SPIF fWinIni);
|
||||||
|
|
||||||
[SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
|
[SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
|
||||||
public static void SystemParametersInfo(SPI uiAction, int uiParam, string pvParam, SPIF fWinIni)
|
public static void SystemParametersInfo(SPI uiAction, int uiParam, string pvParam, SPIF fWinIni)
|
||||||
@@ -792,7 +792,7 @@ namespace Standard
|
|||||||
[SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
|
[SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
|
||||||
public static void UnregisterClass(short atom, IntPtr hinstance)
|
public static void UnregisterClass(short atom, IntPtr hinstance)
|
||||||
{
|
{
|
||||||
if (!NativeMethods._UnregisterClassAtom(new IntPtr((int)atom), hinstance))
|
if (!NativeMethods._UnregisterClassAtom(new IntPtr((int) atom), hinstance))
|
||||||
{
|
{
|
||||||
HRESULT.ThrowLastError();
|
HRESULT.ThrowLastError();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ namespace Standard
|
|||||||
{
|
{
|
||||||
get
|
get
|
||||||
{
|
{
|
||||||
return (VarEnum)this.vt;
|
return (VarEnum) this.vt;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -31,7 +31,7 @@ namespace Standard
|
|||||||
{
|
{
|
||||||
this.Clear();
|
this.Clear();
|
||||||
this.vt = 11;
|
this.vt = 11;
|
||||||
this.boolVal = (short)(f ? -1 : 0);
|
this.boolVal = (short) (f ? -1 : 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
[SuppressMessage("Microsoft.Security", "CA2122:DoNotIndirectlyExposeMethodsWithLinkDemands")]
|
[SuppressMessage("Microsoft.Security", "CA2122:DoNotIndirectlyExposeMethodsWithLinkDemands")]
|
||||||
|
|||||||
@@ -126,7 +126,7 @@ namespace Standard
|
|||||||
bool result;
|
bool result;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
RECT rect = (RECT)obj;
|
RECT rect = (RECT) obj;
|
||||||
result = (rect._bottom == this._bottom && rect._left == this._left && rect._right == this._right && rect._top == this._top);
|
result = (rect._bottom == this._bottom && rect._left == this._left && rect._right == this._right && rect._top == this._top);
|
||||||
}
|
}
|
||||||
catch (InvalidCastException)
|
catch (InvalidCastException)
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ namespace Standard
|
|||||||
private static bool _MemCmp(IntPtr left, IntPtr right, long cb)
|
private static bool _MemCmp(IntPtr left, IntPtr right, long cb)
|
||||||
{
|
{
|
||||||
int num = 0;
|
int num = 0;
|
||||||
while ((long)num < cb - 8L)
|
while ((long) num < cb - 8L)
|
||||||
{
|
{
|
||||||
long num2 = Marshal.ReadInt64(left, num);
|
long num2 = Marshal.ReadInt64(left, num);
|
||||||
long num3 = Marshal.ReadInt64(right, num);
|
long num3 = Marshal.ReadInt64(right, num);
|
||||||
@@ -30,7 +30,7 @@ namespace Standard
|
|||||||
}
|
}
|
||||||
num += 8;
|
num += 8;
|
||||||
}
|
}
|
||||||
while ((long)num < cb)
|
while ((long) num < cb)
|
||||||
{
|
{
|
||||||
byte b = Marshal.ReadByte(left, num);
|
byte b = Marshal.ReadByte(left, num);
|
||||||
byte b2 = Marshal.ReadByte(right, num);
|
byte b2 = Marshal.ReadByte(right, num);
|
||||||
@@ -46,12 +46,12 @@ namespace Standard
|
|||||||
[SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
|
[SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
|
||||||
public static int RGB(Color c)
|
public static int RGB(Color c)
|
||||||
{
|
{
|
||||||
return (int)c.R | (int)c.G << 8 | (int)c.B << 16;
|
return (int) c.R | (int) c.G << 8 | (int) c.B << 16;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Color ColorFromArgbDword(uint color)
|
public static Color ColorFromArgbDword(uint color)
|
||||||
{
|
{
|
||||||
return Color.FromArgb((byte)((color & 4278190080u) >> 24), (byte)((color & 16711680u) >> 16), (byte)((color & 65280u) >> 8), (byte)(color & 255u));
|
return Color.FromArgb((byte) ((color & 4278190080u) >> 24), (byte) ((color & 16711680u) >> 16), (byte) ((color & 65280u) >> 8), (byte) (color & 255u));
|
||||||
}
|
}
|
||||||
|
|
||||||
[SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
|
[SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
|
||||||
@@ -69,13 +69,13 @@ namespace Standard
|
|||||||
[SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
|
[SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
|
||||||
public static int HIWORD(int i)
|
public static int HIWORD(int i)
|
||||||
{
|
{
|
||||||
return (int)((short)(i >> 16));
|
return (int) ((short) (i >> 16));
|
||||||
}
|
}
|
||||||
|
|
||||||
[SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
|
[SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
|
||||||
public static int LOWORD(int i)
|
public static int LOWORD(int i)
|
||||||
{
|
{
|
||||||
return (int)((short)(i & 65535));
|
return (int) ((short) (i & 65535));
|
||||||
}
|
}
|
||||||
|
|
||||||
[SuppressMessage("Microsoft.Security", "CA2122:DoNotIndirectlyExposeMethodsWithLinkDemands")]
|
[SuppressMessage("Microsoft.Security", "CA2122:DoNotIndirectlyExposeMethodsWithLinkDemands")]
|
||||||
@@ -98,7 +98,7 @@ namespace Standard
|
|||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
int num = (int)left.Length;
|
int num = (int) left.Length;
|
||||||
left.Position = 0L;
|
left.Position = 0L;
|
||||||
right.Position = 0L;
|
right.Position = 0L;
|
||||||
int i = 0;
|
int i = 0;
|
||||||
@@ -120,7 +120,7 @@ namespace Standard
|
|||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (!Utility._MemCmp(left2, right2, (long)num3))
|
if (!Utility._MemCmp(left2, right2, (long) num3))
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -217,7 +217,7 @@ namespace Standard
|
|||||||
BitmapFrame bitmapFrame = image as BitmapFrame;
|
BitmapFrame bitmapFrame = image as BitmapFrame;
|
||||||
if (bitmapFrame != null)
|
if (bitmapFrame != null)
|
||||||
{
|
{
|
||||||
bitmapFrame = Utility.GetBestMatch(bitmapFrame.Decoder.Frames, (int)dimensions.Width, (int)dimensions.Height);
|
bitmapFrame = Utility.GetBestMatch(bitmapFrame.Decoder.Frames, (int) dimensions.Width, (int) dimensions.Height);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -242,7 +242,7 @@ namespace Standard
|
|||||||
DrawingContext drawingContext = drawingVisual.RenderOpen();
|
DrawingContext drawingContext = drawingVisual.RenderOpen();
|
||||||
drawingContext.DrawImage(image, rectangle);
|
drawingContext.DrawImage(image, rectangle);
|
||||||
drawingContext.Close();
|
drawingContext.Close();
|
||||||
RenderTargetBitmap renderTargetBitmap = new RenderTargetBitmap((int)dimensions.Width, (int)dimensions.Height, 96.0, 96.0, PixelFormats.Pbgra32);
|
RenderTargetBitmap renderTargetBitmap = new RenderTargetBitmap((int) dimensions.Width, (int) dimensions.Height, 96.0, 96.0, PixelFormats.Pbgra32);
|
||||||
renderTargetBitmap.Render(drawingVisual);
|
renderTargetBitmap.Render(drawingVisual);
|
||||||
bitmapFrame = BitmapFrame.Create(renderTargetBitmap);
|
bitmapFrame = BitmapFrame.Create(renderTargetBitmap);
|
||||||
}
|
}
|
||||||
@@ -543,7 +543,7 @@ namespace Standard
|
|||||||
IntPtr left2 = gchandle.AddrOfPinnedObject();
|
IntPtr left2 = gchandle.AddrOfPinnedObject();
|
||||||
GCHandle gchandle2 = GCHandle.Alloc(right, GCHandleType.Pinned);
|
GCHandle gchandle2 = GCHandle.Alloc(right, GCHandleType.Pinned);
|
||||||
IntPtr right2 = gchandle2.AddrOfPinnedObject();
|
IntPtr right2 = gchandle2.AddrOfPinnedObject();
|
||||||
bool result = Utility._MemCmp(left2, right2, (long)cb);
|
bool result = Utility._MemCmp(left2, right2, (long) cb);
|
||||||
gchandle.Free();
|
gchandle.Free();
|
||||||
gchandle2.Free();
|
gchandle2.Free();
|
||||||
return result;
|
return result;
|
||||||
@@ -577,7 +577,7 @@ namespace Standard
|
|||||||
int num4 = Utility._HexToInt(url[i + 5]);
|
int num4 = Utility._HexToInt(url[i + 5]);
|
||||||
if (num >= 0 && num2 >= 0 && num3 >= 0 && num4 >= 0)
|
if (num >= 0 && num2 >= 0 && num3 >= 0 && num4 >= 0)
|
||||||
{
|
{
|
||||||
urlDecoder.AddChar((char)(num << 12 | num2 << 8 | num3 << 4 | num4));
|
urlDecoder.AddChar((char) (num << 12 | num2 << 8 | num3 << 4 | num4));
|
||||||
i += 5;
|
i += 5;
|
||||||
goto IL_12D;
|
goto IL_12D;
|
||||||
}
|
}
|
||||||
@@ -588,7 +588,7 @@ namespace Standard
|
|||||||
int num6 = Utility._HexToInt(url[i + 2]);
|
int num6 = Utility._HexToInt(url[i + 2]);
|
||||||
if (num5 >= 0 && num6 >= 0)
|
if (num5 >= 0 && num6 >= 0)
|
||||||
{
|
{
|
||||||
urlDecoder.AddByte((byte)(num5 << 4 | num6));
|
urlDecoder.AddByte((byte) (num5 << 4 | num6));
|
||||||
i += 2;
|
i += 2;
|
||||||
goto IL_12D;
|
goto IL_12D;
|
||||||
}
|
}
|
||||||
@@ -596,14 +596,14 @@ namespace Standard
|
|||||||
}
|
}
|
||||||
if ((c & 'タ') == '\0')
|
if ((c & 'タ') == '\0')
|
||||||
{
|
{
|
||||||
urlDecoder.AddByte((byte)c);
|
urlDecoder.AddByte((byte) c);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
urlDecoder.AddChar(c);
|
urlDecoder.AddChar(c);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
IL_12D:;
|
IL_12D:;
|
||||||
}
|
}
|
||||||
return urlDecoder.GetString();
|
return urlDecoder.GetString();
|
||||||
}
|
}
|
||||||
@@ -648,7 +648,7 @@ namespace Standard
|
|||||||
{
|
{
|
||||||
array3[num2++] = 37;
|
array3[num2++] = 37;
|
||||||
array3[num2++] = Utility._IntToHex(b2 >> 4 & 15);
|
array3[num2++] = Utility._IntToHex(b2 >> 4 & 15);
|
||||||
array3[num2++] = Utility._IntToHex((int)(b2 & 15));
|
array3[num2++] = Utility._IntToHex((int) (b2 & 15));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
array = array3;
|
array = array3;
|
||||||
@@ -700,9 +700,9 @@ namespace Standard
|
|||||||
{
|
{
|
||||||
if (n <= 9)
|
if (n <= 9)
|
||||||
{
|
{
|
||||||
return (byte)(n + 48);
|
return (byte) (n + 48);
|
||||||
}
|
}
|
||||||
return (byte)(n - 10 + 65);
|
return (byte) (n - 10 + 65);
|
||||||
}
|
}
|
||||||
|
|
||||||
[SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
|
[SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
|
||||||
@@ -710,15 +710,15 @@ namespace Standard
|
|||||||
{
|
{
|
||||||
if (h >= '0' && h <= '9')
|
if (h >= '0' && h <= '9')
|
||||||
{
|
{
|
||||||
return (int)(h - '0');
|
return (int) (h - '0');
|
||||||
}
|
}
|
||||||
if (h >= 'a' && h <= 'f')
|
if (h >= 'a' && h <= 'f')
|
||||||
{
|
{
|
||||||
return (int)(h - 'a' + '\n');
|
return (int) (h - 'a' + '\n');
|
||||||
}
|
}
|
||||||
if (h >= 'A' && h <= 'F')
|
if (h >= 'A' && h <= 'F')
|
||||||
{
|
{
|
||||||
return (int)(h - 'A' + '\n');
|
return (int) (h - 'A' + '\n');
|
||||||
}
|
}
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -16,14 +16,14 @@ namespace Standard
|
|||||||
{
|
{
|
||||||
if (error._value <= 0)
|
if (error._value <= 0)
|
||||||
{
|
{
|
||||||
return new HRESULT((uint)error._value);
|
return new HRESULT((uint) error._value);
|
||||||
}
|
}
|
||||||
return HRESULT.Make(true, Facility.Win32, error._value & 65535);
|
return HRESULT.Make(true, Facility.Win32, error._value & 65535);
|
||||||
}
|
}
|
||||||
|
|
||||||
public HRESULT ToHRESULT()
|
public HRESULT ToHRESULT()
|
||||||
{
|
{
|
||||||
return (HRESULT)this;
|
return (HRESULT) this;
|
||||||
}
|
}
|
||||||
|
|
||||||
[SuppressMessage("Microsoft.Security", "CA2122:DoNotIndirectlyExposeMethodsWithLinkDemands")]
|
[SuppressMessage("Microsoft.Security", "CA2122:DoNotIndirectlyExposeMethodsWithLinkDemands")]
|
||||||
@@ -37,7 +37,7 @@ namespace Standard
|
|||||||
bool result;
|
bool result;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
result = (((Win32Error)obj)._value == this._value);
|
result = (((Win32Error) obj)._value == this._value);
|
||||||
}
|
}
|
||||||
catch (InvalidCastException)
|
catch (InvalidCastException)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ namespace Microsoft.Windows.Shell
|
|||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
NativeMethods.PostMessage(handle, WM.SYSCOMMAND, new IntPtr((int)command), IntPtr.Zero);
|
NativeMethods.PostMessage(handle, WM.SYSCOMMAND, new IntPtr((int) command), IntPtr.Zero);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void CloseWindow(Window window)
|
public static void CloseWindow(Window window)
|
||||||
@@ -67,10 +67,10 @@ namespace Microsoft.Windows.Shell
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
IntPtr systemMenu = NativeMethods.GetSystemMenu(handle, false);
|
IntPtr systemMenu = NativeMethods.GetSystemMenu(handle, false);
|
||||||
uint num = NativeMethods.TrackPopupMenuEx(systemMenu, 256u, (int)physicalScreenLocation.X, (int)physicalScreenLocation.Y, handle, IntPtr.Zero);
|
uint num = NativeMethods.TrackPopupMenuEx(systemMenu, 256u, (int) physicalScreenLocation.X, (int) physicalScreenLocation.Y, handle, IntPtr.Zero);
|
||||||
if (num != 0u)
|
if (num != 0u)
|
||||||
{
|
{
|
||||||
NativeMethods.PostMessage(handle, WM.SYSCOMMAND, new IntPtr((long)((ulong)num)), IntPtr.Zero);
|
NativeMethods.PostMessage(handle, WM.SYSCOMMAND, new IntPtr((long) ((ulong) num)), IntPtr.Zero);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -38,7 +38,7 @@ namespace Microsoft.Windows.Shell
|
|||||||
private void _UpdateGlassColor(IntPtr wParam, IntPtr lParam)
|
private void _UpdateGlassColor(IntPtr wParam, IntPtr lParam)
|
||||||
{
|
{
|
||||||
bool flag = lParam != IntPtr.Zero;
|
bool flag = lParam != IntPtr.Zero;
|
||||||
uint num = (uint)((int)wParam.ToInt64());
|
uint num = (uint) ((int) wParam.ToInt64());
|
||||||
num |= (flag ? 4278190080u : 0u);
|
num |= (flag ? 4278190080u : 0u);
|
||||||
this.WindowGlassColor = Utility.ColorFromArgbDword(num);
|
this.WindowGlassColor = Utility.ColorFromArgbDword(num);
|
||||||
SolidColorBrush solidColorBrush = new SolidColorBrush(this.WindowGlassColor);
|
SolidColorBrush solidColorBrush = new SolidColorBrush(this.WindowGlassColor);
|
||||||
@@ -48,7 +48,7 @@ namespace Microsoft.Windows.Shell
|
|||||||
|
|
||||||
private void _InitializeCaptionHeight()
|
private void _InitializeCaptionHeight()
|
||||||
{
|
{
|
||||||
Point devicePoint = new Point(0.0, (double)NativeMethods.GetSystemMetrics(SM.CYCAPTION));
|
Point devicePoint = new Point(0.0, (double) NativeMethods.GetSystemMetrics(SM.CYCAPTION));
|
||||||
this.WindowCaptionHeight = DpiHelper.DevicePixelsToLogical(devicePoint).Y;
|
this.WindowCaptionHeight = DpiHelper.DevicePixelsToLogical(devicePoint).Y;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -59,7 +59,7 @@ namespace Microsoft.Windows.Shell
|
|||||||
|
|
||||||
private void _InitializeWindowResizeBorderThickness()
|
private void _InitializeWindowResizeBorderThickness()
|
||||||
{
|
{
|
||||||
Size deviceSize = new Size((double)NativeMethods.GetSystemMetrics(SM.CXFRAME), (double)NativeMethods.GetSystemMetrics(SM.CYFRAME));
|
Size deviceSize = new Size((double) NativeMethods.GetSystemMetrics(SM.CXFRAME), (double) NativeMethods.GetSystemMetrics(SM.CYFRAME));
|
||||||
Size size = DpiHelper.DeviceSizeToLogical(deviceSize);
|
Size size = DpiHelper.DeviceSizeToLogical(deviceSize);
|
||||||
this.WindowResizeBorderThickness = new Thickness(size.Width, size.Height, size.Width, size.Height);
|
this.WindowResizeBorderThickness = new Thickness(size.Width, size.Height, size.Width, size.Height);
|
||||||
}
|
}
|
||||||
@@ -71,10 +71,10 @@ namespace Microsoft.Windows.Shell
|
|||||||
|
|
||||||
private void _InitializeWindowNonClientFrameThickness()
|
private void _InitializeWindowNonClientFrameThickness()
|
||||||
{
|
{
|
||||||
Size deviceSize = new Size((double)NativeMethods.GetSystemMetrics(SM.CXFRAME), (double)NativeMethods.GetSystemMetrics(SM.CYFRAME));
|
Size deviceSize = new Size((double) NativeMethods.GetSystemMetrics(SM.CXFRAME), (double) NativeMethods.GetSystemMetrics(SM.CYFRAME));
|
||||||
Size size = DpiHelper.DeviceSizeToLogical(deviceSize);
|
Size size = DpiHelper.DeviceSizeToLogical(deviceSize);
|
||||||
int systemMetrics = NativeMethods.GetSystemMetrics(SM.CYCAPTION);
|
int systemMetrics = NativeMethods.GetSystemMetrics(SM.CYCAPTION);
|
||||||
double y = DpiHelper.DevicePixelsToLogical(new Point(0.0, (double)systemMetrics)).Y;
|
double y = DpiHelper.DevicePixelsToLogical(new Point(0.0, (double) systemMetrics)).Y;
|
||||||
this.WindowNonClientFrameThickness = new Thickness(size.Width, size.Height + y, size.Width, size.Height);
|
this.WindowNonClientFrameThickness = new Thickness(size.Width, size.Height + y, size.Width, size.Height);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -85,7 +85,7 @@ namespace Microsoft.Windows.Shell
|
|||||||
|
|
||||||
private void _InitializeSmallIconSize()
|
private void _InitializeSmallIconSize()
|
||||||
{
|
{
|
||||||
this.SmallIconSize = new Size((double)NativeMethods.GetSystemMetrics(SM.CXSMICON), (double)NativeMethods.GetSystemMetrics(SM.CYSMICON));
|
this.SmallIconSize = new Size((double) NativeMethods.GetSystemMetrics(SM.CXSMICON), (double) NativeMethods.GetSystemMetrics(SM.CYSMICON));
|
||||||
}
|
}
|
||||||
|
|
||||||
private void _UpdateSmallIconSize(IntPtr wParam, IntPtr lParam)
|
private void _UpdateSmallIconSize(IntPtr wParam, IntPtr lParam)
|
||||||
@@ -99,8 +99,8 @@ namespace Microsoft.Windows.Shell
|
|||||||
int systemMetrics2 = NativeMethods.GetSystemMetrics(SM.CYSIZE);
|
int systemMetrics2 = NativeMethods.GetSystemMetrics(SM.CYSIZE);
|
||||||
int num = NativeMethods.GetSystemMetrics(SM.CXFRAME) + NativeMethods.GetSystemMetrics(SM.CXEDGE);
|
int num = NativeMethods.GetSystemMetrics(SM.CXFRAME) + NativeMethods.GetSystemMetrics(SM.CXEDGE);
|
||||||
int num2 = NativeMethods.GetSystemMetrics(SM.CYFRAME) + NativeMethods.GetSystemMetrics(SM.CYEDGE);
|
int num2 = NativeMethods.GetSystemMetrics(SM.CYFRAME) + NativeMethods.GetSystemMetrics(SM.CYEDGE);
|
||||||
Rect windowCaptionButtonsLocation = new Rect(0.0, 0.0, (double)(systemMetrics * 3), (double)systemMetrics2);
|
Rect windowCaptionButtonsLocation = new Rect(0.0, 0.0, (double) (systemMetrics * 3), (double) systemMetrics2);
|
||||||
windowCaptionButtonsLocation.Offset((double)(-(double)num) - windowCaptionButtonsLocation.Width, (double)num2);
|
windowCaptionButtonsLocation.Offset((double) (-(double) num) - windowCaptionButtonsLocation.Width, (double) num2);
|
||||||
this.WindowCaptionButtonsLocation = windowCaptionButtonsLocation;
|
this.WindowCaptionButtonsLocation = windowCaptionButtonsLocation;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -122,7 +122,7 @@ namespace Microsoft.Windows.Shell
|
|||||||
Marshal.StructureToPtr(titlebarinfoex, intPtr, false);
|
Marshal.StructureToPtr(titlebarinfoex, intPtr, false);
|
||||||
NativeMethods.ShowWindow(this._messageHwnd.Handle, SW.SHOW);
|
NativeMethods.ShowWindow(this._messageHwnd.Handle, SW.SHOW);
|
||||||
NativeMethods.SendMessage(this._messageHwnd.Handle, WM.GETTITLEBARINFOEX, IntPtr.Zero, intPtr);
|
NativeMethods.SendMessage(this._messageHwnd.Handle, WM.GETTITLEBARINFOEX, IntPtr.Zero, intPtr);
|
||||||
titlebarinfoex = (TITLEBARINFOEX)Marshal.PtrToStructure(intPtr, typeof(TITLEBARINFOEX));
|
titlebarinfoex = (TITLEBARINFOEX) Marshal.PtrToStructure(intPtr, typeof(TITLEBARINFOEX));
|
||||||
}
|
}
|
||||||
finally
|
finally
|
||||||
{
|
{
|
||||||
@@ -131,7 +131,7 @@ namespace Microsoft.Windows.Shell
|
|||||||
}
|
}
|
||||||
RECT rect = RECT.Union(titlebarinfoex.rgrect_CloseButton, titlebarinfoex.rgrect_MinimizeButton);
|
RECT rect = RECT.Union(titlebarinfoex.rgrect_CloseButton, titlebarinfoex.rgrect_MinimizeButton);
|
||||||
RECT windowRect = NativeMethods.GetWindowRect(this._messageHwnd.Handle);
|
RECT windowRect = NativeMethods.GetWindowRect(this._messageHwnd.Handle);
|
||||||
Rect deviceRectangle = new Rect((double)(rect.Left - windowRect.Width - windowRect.Left), (double)(rect.Top - windowRect.Top), (double)rect.Width, (double)rect.Height);
|
Rect deviceRectangle = new Rect((double) (rect.Left - windowRect.Width - windowRect.Left), (double) (rect.Top - windowRect.Top), (double) rect.Width, (double) rect.Height);
|
||||||
Rect windowCaptionButtonsLocation = DpiHelper.DeviceRectToLogical(deviceRectangle);
|
Rect windowCaptionButtonsLocation = DpiHelper.DeviceRectToLogical(deviceRectangle);
|
||||||
this.WindowCaptionButtonsLocation = windowCaptionButtonsLocation;
|
this.WindowCaptionButtonsLocation = windowCaptionButtonsLocation;
|
||||||
}
|
}
|
||||||
@@ -143,7 +143,7 @@ namespace Microsoft.Windows.Shell
|
|||||||
|
|
||||||
private void _InitializeHighContrast()
|
private void _InitializeHighContrast()
|
||||||
{
|
{
|
||||||
this.HighContrast = ((NativeMethods.SystemParameterInfo_GetHIGHCONTRAST().dwFlags & HCF.HIGHCONTRASTON) != (HCF)0);
|
this.HighContrast = ((NativeMethods.SystemParameterInfo_GetHIGHCONTRAST().dwFlags & HCF.HIGHCONTRASTON) != (HCF) 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void _UpdateHighContrast(IntPtr wParam, IntPtr lParam)
|
private void _UpdateHighContrast(IntPtr wParam, IntPtr lParam)
|
||||||
@@ -201,7 +201,7 @@ namespace Microsoft.Windows.Shell
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
windowCornerRadius = new CornerRadius(0.0);
|
windowCornerRadius = new CornerRadius(0.0);
|
||||||
IL_E6:
|
IL_E6:
|
||||||
this.WindowCornerRadius = windowCornerRadius;
|
this.WindowCornerRadius = windowCornerRadius;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -212,8 +212,8 @@ namespace Microsoft.Windows.Shell
|
|||||||
|
|
||||||
private SystemParameters2()
|
private SystemParameters2()
|
||||||
{
|
{
|
||||||
this._messageHwnd = new MessageWindow((CS)0u, WS.DISABLED | WS.BORDER | WS.DLGFRAME | WS.SYSMENU | WS.THICKFRAME | WS.GROUP | WS.TABSTOP, WS_EX.None, new Rect(-16000.0, -16000.0, 100.0, 100.0), "", new WndProc(this._WndProc));
|
this._messageHwnd = new MessageWindow((CS) 0u, WS.DISABLED | WS.BORDER | WS.DLGFRAME | WS.SYSMENU | WS.THICKFRAME | WS.GROUP | WS.TABSTOP, WS_EX.None, new Rect(-16000.0, -16000.0, 100.0, 100.0), "", new WndProc(this._WndProc));
|
||||||
this._messageHwnd.Dispatcher.ShutdownStarted += delegate(object sender, EventArgs e)
|
this._messageHwnd.Dispatcher.ShutdownStarted += delegate (object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
Utility.SafeDispose<MessageWindow>(ref this._messageHwnd);
|
Utility.SafeDispose<MessageWindow>(ref this._messageHwnd);
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ namespace Microsoft.Windows.Shell
|
|||||||
public static TaskbarItemInfo GetTaskbarItemInfo(Window window)
|
public static TaskbarItemInfo GetTaskbarItemInfo(Window window)
|
||||||
{
|
{
|
||||||
Verify.IsNotNull<Window>(window, "window");
|
Verify.IsNotNull<Window>(window, "window");
|
||||||
return (TaskbarItemInfo)window.GetValue(TaskbarItemInfo.TaskbarItemInfoProperty);
|
return (TaskbarItemInfo) window.GetValue(TaskbarItemInfo.TaskbarItemInfoProperty);
|
||||||
}
|
}
|
||||||
|
|
||||||
[SuppressMessage("Microsoft.Design", "CA1062:Validate arguments of public methods", MessageId = "0")]
|
[SuppressMessage("Microsoft.Design", "CA1062:Validate arguments of public methods", MessageId = "0")]
|
||||||
@@ -35,9 +35,9 @@ namespace Microsoft.Windows.Shell
|
|||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
Window window = (Window)d;
|
Window window = (Window) d;
|
||||||
TaskbarItemInfo taskbarItemInfo = (TaskbarItemInfo)e.OldValue;
|
TaskbarItemInfo taskbarItemInfo = (TaskbarItemInfo) e.OldValue;
|
||||||
TaskbarItemInfo taskbarItemInfo2 = (TaskbarItemInfo)e.NewValue;
|
TaskbarItemInfo taskbarItemInfo2 = (TaskbarItemInfo) e.NewValue;
|
||||||
if (taskbarItemInfo == taskbarItemInfo2)
|
if (taskbarItemInfo == taskbarItemInfo2)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
@@ -63,8 +63,8 @@ namespace Microsoft.Windows.Shell
|
|||||||
return value;
|
return value;
|
||||||
}
|
}
|
||||||
Verify.IsNotNull<DependencyObject>(d, "d");
|
Verify.IsNotNull<DependencyObject>(d, "d");
|
||||||
Window window = (Window)d;
|
Window window = (Window) d;
|
||||||
TaskbarItemInfo taskbarItemInfo = (TaskbarItemInfo)value;
|
TaskbarItemInfo taskbarItemInfo = (TaskbarItemInfo) value;
|
||||||
if (taskbarItemInfo != null && taskbarItemInfo._window != null && taskbarItemInfo._window != window)
|
if (taskbarItemInfo != null && taskbarItemInfo._window != null && taskbarItemInfo._window != window)
|
||||||
{
|
{
|
||||||
throw new NotSupportedException();
|
throw new NotSupportedException();
|
||||||
@@ -77,7 +77,7 @@ namespace Microsoft.Windows.Shell
|
|||||||
{
|
{
|
||||||
get
|
get
|
||||||
{
|
{
|
||||||
return (TaskbarItemProgressState)base.GetValue(TaskbarItemInfo.ProgressStateProperty);
|
return (TaskbarItemProgressState) base.GetValue(TaskbarItemInfo.ProgressStateProperty);
|
||||||
}
|
}
|
||||||
set
|
set
|
||||||
{
|
{
|
||||||
@@ -115,7 +115,7 @@ namespace Microsoft.Windows.Shell
|
|||||||
{
|
{
|
||||||
get
|
get
|
||||||
{
|
{
|
||||||
return (double)base.GetValue(TaskbarItemInfo.ProgressValueProperty);
|
return (double) base.GetValue(TaskbarItemInfo.ProgressValueProperty);
|
||||||
}
|
}
|
||||||
set
|
set
|
||||||
{
|
{
|
||||||
@@ -147,7 +147,7 @@ namespace Microsoft.Windows.Shell
|
|||||||
{
|
{
|
||||||
get
|
get
|
||||||
{
|
{
|
||||||
return (ImageSource)base.GetValue(TaskbarItemInfo.OverlayProperty);
|
return (ImageSource) base.GetValue(TaskbarItemInfo.OverlayProperty);
|
||||||
}
|
}
|
||||||
set
|
set
|
||||||
{
|
{
|
||||||
@@ -168,7 +168,7 @@ namespace Microsoft.Windows.Shell
|
|||||||
{
|
{
|
||||||
get
|
get
|
||||||
{
|
{
|
||||||
return (string)base.GetValue(TaskbarItemInfo.DescriptionProperty);
|
return (string) base.GetValue(TaskbarItemInfo.DescriptionProperty);
|
||||||
}
|
}
|
||||||
set
|
set
|
||||||
{
|
{
|
||||||
@@ -189,7 +189,7 @@ namespace Microsoft.Windows.Shell
|
|||||||
{
|
{
|
||||||
get
|
get
|
||||||
{
|
{
|
||||||
return (Thickness)base.GetValue(TaskbarItemInfo.ThumbnailClipMarginProperty);
|
return (Thickness) base.GetValue(TaskbarItemInfo.ThumbnailClipMarginProperty);
|
||||||
}
|
}
|
||||||
set
|
set
|
||||||
{
|
{
|
||||||
@@ -221,7 +221,7 @@ namespace Microsoft.Windows.Shell
|
|||||||
{
|
{
|
||||||
get
|
get
|
||||||
{
|
{
|
||||||
return (ThumbButtonInfoCollection)base.GetValue(TaskbarItemInfo.ThumbButtonInfosProperty);
|
return (ThumbButtonInfoCollection) base.GetValue(TaskbarItemInfo.ThumbButtonInfosProperty);
|
||||||
}
|
}
|
||||||
set
|
set
|
||||||
{
|
{
|
||||||
@@ -263,7 +263,7 @@ namespace Microsoft.Windows.Shell
|
|||||||
{
|
{
|
||||||
Utility.SafeRelease<ITaskbarList>(ref taskbarList);
|
Utility.SafeRelease<ITaskbarList>(ref taskbarList);
|
||||||
}
|
}
|
||||||
this._overlaySize = new Size((double)NativeMethods.GetSystemMetrics(SM.CXSMICON), (double)NativeMethods.GetSystemMetrics(SM.CYSMICON));
|
this._overlaySize = new Size((double) NativeMethods.GetSystemMetrics(SM.CXSMICON), (double) NativeMethods.GetSystemMetrics(SM.CYSMICON));
|
||||||
}
|
}
|
||||||
this.ThumbButtonInfos = new ThumbButtonInfoCollection();
|
this.ThumbButtonInfos = new ThumbButtonInfoCollection();
|
||||||
}
|
}
|
||||||
@@ -303,7 +303,7 @@ namespace Microsoft.Windows.Shell
|
|||||||
|
|
||||||
private IntPtr _WndProc(IntPtr hwnd, int uMsg, IntPtr wParam, IntPtr lParam, ref bool handled)
|
private IntPtr _WndProc(IntPtr hwnd, int uMsg, IntPtr wParam, IntPtr lParam, ref bool handled)
|
||||||
{
|
{
|
||||||
if (uMsg == (int)TaskbarItemInfo.WM_TASKBARBUTTONCREATED)
|
if (uMsg == (int) TaskbarItemInfo.WM_TASKBARBUTTONCREATED)
|
||||||
{
|
{
|
||||||
this._OnIsAttachedChanged(true);
|
this._OnIsAttachedChanged(true);
|
||||||
this._isAttached = true;
|
this._isAttached = true;
|
||||||
@@ -390,7 +390,7 @@ namespace Microsoft.Windows.Shell
|
|||||||
{
|
{
|
||||||
return HRESULT.S_OK;
|
return HRESULT.S_OK;
|
||||||
}
|
}
|
||||||
ulong ullCompleted = (ulong)(this.ProgressValue * 1000.0);
|
ulong ullCompleted = (ulong) (this.ProgressValue * 1000.0);
|
||||||
return this._taskbarList.SetProgressValue(this._hwndSource.Handle, ullCompleted, 1000UL);
|
return this._taskbarList.SetProgressValue(this._hwndSource.Handle, ullCompleted, 1000UL);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -437,7 +437,7 @@ namespace Microsoft.Windows.Shell
|
|||||||
{
|
{
|
||||||
Thickness thumbnailClipMargin = this.ThumbnailClipMargin;
|
Thickness thumbnailClipMargin = this.ThumbnailClipMargin;
|
||||||
RECT clientRect = NativeMethods.GetClientRect(this._hwndSource.Handle);
|
RECT clientRect = NativeMethods.GetClientRect(this._hwndSource.Handle);
|
||||||
Rect rect = DpiHelper.DeviceRectToLogical(new Rect((double)clientRect.Left, (double)clientRect.Top, (double)clientRect.Width, (double)clientRect.Height));
|
Rect rect = DpiHelper.DeviceRectToLogical(new Rect((double) clientRect.Left, (double) clientRect.Top, (double) clientRect.Width, (double) clientRect.Height));
|
||||||
if (thumbnailClipMargin.Left + thumbnailClipMargin.Right >= rect.Width || thumbnailClipMargin.Top + thumbnailClipMargin.Bottom >= rect.Height)
|
if (thumbnailClipMargin.Left + thumbnailClipMargin.Right >= rect.Width || thumbnailClipMargin.Top + thumbnailClipMargin.Bottom >= rect.Height)
|
||||||
{
|
{
|
||||||
prcClip = new RefRECT(0, 0, 0, 0);
|
prcClip = new RefRECT(0, 0, 0, 0);
|
||||||
@@ -446,7 +446,7 @@ namespace Microsoft.Windows.Shell
|
|||||||
{
|
{
|
||||||
Rect logicalRectangle = new Rect(thumbnailClipMargin.Left, thumbnailClipMargin.Top, rect.Width - thumbnailClipMargin.Left - thumbnailClipMargin.Right, rect.Height - thumbnailClipMargin.Top - thumbnailClipMargin.Bottom);
|
Rect logicalRectangle = new Rect(thumbnailClipMargin.Left, thumbnailClipMargin.Top, rect.Width - thumbnailClipMargin.Left - thumbnailClipMargin.Right, rect.Height - thumbnailClipMargin.Top - thumbnailClipMargin.Bottom);
|
||||||
Rect rect2 = DpiHelper.LogicalRectToDevice(logicalRectangle);
|
Rect rect2 = DpiHelper.LogicalRectToDevice(logicalRectangle);
|
||||||
prcClip = new RefRECT((int)rect2.Left, (int)rect2.Top, (int)rect2.Right, (int)rect2.Bottom);
|
prcClip = new RefRECT((int) rect2.Left, (int) rect2.Top, (int) rect2.Right, (int) rect2.Bottom);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return this._taskbarList.SetThumbnailClip(this._hwndSource.Handle, prcClip);
|
return this._taskbarList.SetThumbnailClip(this._hwndSource.Handle, prcClip);
|
||||||
@@ -462,12 +462,12 @@ namespace Microsoft.Windows.Shell
|
|||||||
{
|
{
|
||||||
array[i] = new THUMBBUTTON
|
array[i] = new THUMBBUTTON
|
||||||
{
|
{
|
||||||
iId = (uint)i,
|
iId = (uint) i,
|
||||||
dwFlags = (THBF.DISABLED | THBF.NOBACKGROUND | THBF.HIDDEN),
|
dwFlags = (THBF.DISABLED | THBF.NOBACKGROUND | THBF.HIDDEN),
|
||||||
dwMask = (THB.ICON | THB.TOOLTIP | THB.FLAGS)
|
dwMask = (THB.ICON | THB.TOOLTIP | THB.FLAGS)
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
hresult = this._taskbarList.ThumbBarAddButtons(this._hwndSource.Handle, (uint)array.Length, array);
|
hresult = this._taskbarList.ThumbBarAddButtons(this._hwndSource.Handle, (uint) array.Length, array);
|
||||||
if (hresult == HRESULT.E_INVALIDARG)
|
if (hresult == HRESULT.E_INVALIDARG)
|
||||||
{
|
{
|
||||||
hresult = HRESULT.S_FALSE;
|
hresult = HRESULT.S_FALSE;
|
||||||
@@ -518,15 +518,15 @@ namespace Microsoft.Windows.Shell
|
|||||||
default:
|
default:
|
||||||
goto IL_A5;
|
goto IL_A5;
|
||||||
}
|
}
|
||||||
IL_146:
|
IL_146:
|
||||||
array[(int)((UIntPtr)num)] = thumbbutton;
|
array[(int) ((UIntPtr) num)] = thumbbutton;
|
||||||
num += 1u;
|
num += 1u;
|
||||||
if (num != 7u)
|
if (num != 7u)
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
IL_A5:
|
IL_A5:
|
||||||
thumbbutton.szTip = (thumbButtonInfo.Description ?? "");
|
thumbbutton.szTip = (thumbButtonInfo.Description ?? "");
|
||||||
thumbbutton.hIcon = this._GetHICONFromImageSource(thumbButtonInfo.ImageSource, this._overlaySize);
|
thumbbutton.hIcon = this._GetHICONFromImageSource(thumbButtonInfo.ImageSource, this._overlaySize);
|
||||||
if (!thumbButtonInfo.IsBackgroundVisible)
|
if (!thumbButtonInfo.IsBackgroundVisible)
|
||||||
@@ -554,20 +554,20 @@ namespace Microsoft.Windows.Shell
|
|||||||
}
|
}
|
||||||
goto IL_1AE;
|
goto IL_1AE;
|
||||||
}
|
}
|
||||||
IL_179:
|
IL_179:
|
||||||
array[(int)((UIntPtr)num)] = new THUMBBUTTON
|
array[(int) ((UIntPtr) num)] = new THUMBBUTTON
|
||||||
{
|
{
|
||||||
iId = num,
|
iId = num,
|
||||||
dwFlags = (THBF.DISABLED | THBF.NOBACKGROUND | THBF.HIDDEN),
|
dwFlags = (THBF.DISABLED | THBF.NOBACKGROUND | THBF.HIDDEN),
|
||||||
dwMask = (THB.ICON | THB.TOOLTIP | THB.FLAGS)
|
dwMask = (THB.ICON | THB.TOOLTIP | THB.FLAGS)
|
||||||
};
|
};
|
||||||
num += 1u;
|
num += 1u;
|
||||||
IL_1AE:
|
IL_1AE:
|
||||||
if (num < 7u)
|
if (num < 7u)
|
||||||
{
|
{
|
||||||
goto IL_179;
|
goto IL_179;
|
||||||
}
|
}
|
||||||
result2 = this._taskbarList.ThumbBarUpdateButtons(this._hwndSource.Handle, (uint)array.Length, array);
|
result2 = this._taskbarList.ThumbBarUpdateButtons(this._hwndSource.Handle, (uint) array.Length, array);
|
||||||
}
|
}
|
||||||
finally
|
finally
|
||||||
{
|
{
|
||||||
@@ -605,35 +605,35 @@ namespace Microsoft.Windows.Shell
|
|||||||
|
|
||||||
public static readonly DependencyProperty TaskbarItemInfoProperty = DependencyProperty.RegisterAttached("TaskbarItemInfo", typeof(TaskbarItemInfo), typeof(TaskbarItemInfo), new PropertyMetadata(null, new PropertyChangedCallback(TaskbarItemInfo._OnTaskbarItemInfoChanged), new CoerceValueCallback(TaskbarItemInfo._CoerceTaskbarItemInfoValue)));
|
public static readonly DependencyProperty TaskbarItemInfoProperty = DependencyProperty.RegisterAttached("TaskbarItemInfo", typeof(TaskbarItemInfo), typeof(TaskbarItemInfo), new PropertyMetadata(null, new PropertyChangedCallback(TaskbarItemInfo._OnTaskbarItemInfoChanged), new CoerceValueCallback(TaskbarItemInfo._CoerceTaskbarItemInfoValue)));
|
||||||
|
|
||||||
public static readonly DependencyProperty ProgressStateProperty = DependencyProperty.Register("ProgressState", typeof(TaskbarItemProgressState), typeof(TaskbarItemInfo), new PropertyMetadata(TaskbarItemProgressState.None, delegate(DependencyObject d, DependencyPropertyChangedEventArgs e)
|
public static readonly DependencyProperty ProgressStateProperty = DependencyProperty.Register("ProgressState", typeof(TaskbarItemProgressState), typeof(TaskbarItemInfo), new PropertyMetadata(TaskbarItemProgressState.None, delegate (DependencyObject d, DependencyPropertyChangedEventArgs e)
|
||||||
{
|
{
|
||||||
((TaskbarItemInfo)d)._OnProgressStateChanged();
|
((TaskbarItemInfo) d)._OnProgressStateChanged();
|
||||||
}, (DependencyObject d, object e) => TaskbarItemInfo._CoerceProgressState((TaskbarItemProgressState)e)));
|
}, (DependencyObject d, object e) => TaskbarItemInfo._CoerceProgressState((TaskbarItemProgressState) e)));
|
||||||
|
|
||||||
public static readonly DependencyProperty ProgressValueProperty = DependencyProperty.Register("ProgressValue", typeof(double), typeof(TaskbarItemInfo), new PropertyMetadata(0.0, delegate(DependencyObject d, DependencyPropertyChangedEventArgs e)
|
public static readonly DependencyProperty ProgressValueProperty = DependencyProperty.Register("ProgressValue", typeof(double), typeof(TaskbarItemInfo), new PropertyMetadata(0.0, delegate (DependencyObject d, DependencyPropertyChangedEventArgs e)
|
||||||
{
|
{
|
||||||
((TaskbarItemInfo)d)._OnProgressValueChanged();
|
((TaskbarItemInfo) d)._OnProgressValueChanged();
|
||||||
}, (DependencyObject d, object e) => TaskbarItemInfo._CoerceProgressValue((double)e)));
|
}, (DependencyObject d, object e) => TaskbarItemInfo._CoerceProgressValue((double) e)));
|
||||||
|
|
||||||
public static readonly DependencyProperty OverlayProperty = DependencyProperty.Register("Overlay", typeof(ImageSource), typeof(TaskbarItemInfo), new PropertyMetadata(null, delegate(DependencyObject d, DependencyPropertyChangedEventArgs e)
|
public static readonly DependencyProperty OverlayProperty = DependencyProperty.Register("Overlay", typeof(ImageSource), typeof(TaskbarItemInfo), new PropertyMetadata(null, delegate (DependencyObject d, DependencyPropertyChangedEventArgs e)
|
||||||
{
|
{
|
||||||
((TaskbarItemInfo)d)._OnOverlayChanged();
|
((TaskbarItemInfo) d)._OnOverlayChanged();
|
||||||
}));
|
}));
|
||||||
|
|
||||||
public static readonly DependencyProperty DescriptionProperty = DependencyProperty.Register("Description", typeof(string), typeof(TaskbarItemInfo), new PropertyMetadata(string.Empty, delegate(DependencyObject d, DependencyPropertyChangedEventArgs e)
|
public static readonly DependencyProperty DescriptionProperty = DependencyProperty.Register("Description", typeof(string), typeof(TaskbarItemInfo), new PropertyMetadata(string.Empty, delegate (DependencyObject d, DependencyPropertyChangedEventArgs e)
|
||||||
{
|
{
|
||||||
((TaskbarItemInfo)d)._OnDescriptionChanged();
|
((TaskbarItemInfo) d)._OnDescriptionChanged();
|
||||||
}));
|
}));
|
||||||
|
|
||||||
public static readonly DependencyProperty ThumbnailClipMarginProperty = DependencyProperty.Register("ThumbnailClipMargin", typeof(Thickness), typeof(TaskbarItemInfo), new PropertyMetadata(default(Thickness), delegate(DependencyObject d, DependencyPropertyChangedEventArgs e)
|
public static readonly DependencyProperty ThumbnailClipMarginProperty = DependencyProperty.Register("ThumbnailClipMargin", typeof(Thickness), typeof(TaskbarItemInfo), new PropertyMetadata(default(Thickness), delegate (DependencyObject d, DependencyPropertyChangedEventArgs e)
|
||||||
{
|
{
|
||||||
((TaskbarItemInfo)d)._OnThumbnailClipMarginChanged();
|
((TaskbarItemInfo) d)._OnThumbnailClipMarginChanged();
|
||||||
}, (DependencyObject d, object e) => TaskbarItemInfo._CoerceThumbnailClipMargin((Thickness)e)));
|
}, (DependencyObject d, object e) => TaskbarItemInfo._CoerceThumbnailClipMargin((Thickness) e)));
|
||||||
|
|
||||||
[SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Infos")]
|
[SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Infos")]
|
||||||
public static readonly DependencyProperty ThumbButtonInfosProperty = DependencyProperty.Register("ThumbButtonInfos", typeof(ThumbButtonInfoCollection), typeof(TaskbarItemInfo), new PropertyMetadata(null, delegate(DependencyObject d, DependencyPropertyChangedEventArgs e)
|
public static readonly DependencyProperty ThumbButtonInfosProperty = DependencyProperty.Register("ThumbButtonInfos", typeof(ThumbButtonInfoCollection), typeof(TaskbarItemInfo), new PropertyMetadata(null, delegate (DependencyObject d, DependencyPropertyChangedEventArgs e)
|
||||||
{
|
{
|
||||||
((TaskbarItemInfo)d)._OnThumbButtonsChanged();
|
((TaskbarItemInfo) d)._OnThumbButtonsChanged();
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -18,7 +18,7 @@ namespace Microsoft.Windows.Shell
|
|||||||
{
|
{
|
||||||
get
|
get
|
||||||
{
|
{
|
||||||
return (Visibility)base.GetValue(ThumbButtonInfo.VisibilityProperty);
|
return (Visibility) base.GetValue(ThumbButtonInfo.VisibilityProperty);
|
||||||
}
|
}
|
||||||
set
|
set
|
||||||
{
|
{
|
||||||
@@ -30,7 +30,7 @@ namespace Microsoft.Windows.Shell
|
|||||||
{
|
{
|
||||||
get
|
get
|
||||||
{
|
{
|
||||||
return (bool)base.GetValue(ThumbButtonInfo.DismissWhenClickedProperty);
|
return (bool) base.GetValue(ThumbButtonInfo.DismissWhenClickedProperty);
|
||||||
}
|
}
|
||||||
set
|
set
|
||||||
{
|
{
|
||||||
@@ -42,7 +42,7 @@ namespace Microsoft.Windows.Shell
|
|||||||
{
|
{
|
||||||
get
|
get
|
||||||
{
|
{
|
||||||
return (ImageSource)base.GetValue(ThumbButtonInfo.ImageSourceProperty);
|
return (ImageSource) base.GetValue(ThumbButtonInfo.ImageSourceProperty);
|
||||||
}
|
}
|
||||||
set
|
set
|
||||||
{
|
{
|
||||||
@@ -54,7 +54,7 @@ namespace Microsoft.Windows.Shell
|
|||||||
{
|
{
|
||||||
get
|
get
|
||||||
{
|
{
|
||||||
return (bool)base.GetValue(ThumbButtonInfo.IsBackgroundVisibleProperty);
|
return (bool) base.GetValue(ThumbButtonInfo.IsBackgroundVisibleProperty);
|
||||||
}
|
}
|
||||||
set
|
set
|
||||||
{
|
{
|
||||||
@@ -66,7 +66,7 @@ namespace Microsoft.Windows.Shell
|
|||||||
{
|
{
|
||||||
get
|
get
|
||||||
{
|
{
|
||||||
return (string)base.GetValue(ThumbButtonInfo.DescriptionProperty);
|
return (string) base.GetValue(ThumbButtonInfo.DescriptionProperty);
|
||||||
}
|
}
|
||||||
set
|
set
|
||||||
{
|
{
|
||||||
@@ -76,7 +76,7 @@ namespace Microsoft.Windows.Shell
|
|||||||
|
|
||||||
private static object _CoerceDescription(DependencyObject d, object value)
|
private static object _CoerceDescription(DependencyObject d, object value)
|
||||||
{
|
{
|
||||||
string text = (string)value;
|
string text = (string) value;
|
||||||
if (text != null && text.Length >= 260)
|
if (text != null && text.Length >= 260)
|
||||||
{
|
{
|
||||||
text = text.Substring(0, 259);
|
text = text.Substring(0, 259);
|
||||||
@@ -86,7 +86,7 @@ namespace Microsoft.Windows.Shell
|
|||||||
|
|
||||||
private object _CoerceIsEnabledValue(object value)
|
private object _CoerceIsEnabledValue(object value)
|
||||||
{
|
{
|
||||||
bool flag = (bool)value;
|
bool flag = (bool) value;
|
||||||
return flag && this._CanExecute;
|
return flag && this._CanExecute;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -94,7 +94,7 @@ namespace Microsoft.Windows.Shell
|
|||||||
{
|
{
|
||||||
get
|
get
|
||||||
{
|
{
|
||||||
return (bool)base.GetValue(ThumbButtonInfo.IsEnabledProperty);
|
return (bool) base.GetValue(ThumbButtonInfo.IsEnabledProperty);
|
||||||
}
|
}
|
||||||
set
|
set
|
||||||
{
|
{
|
||||||
@@ -106,7 +106,7 @@ namespace Microsoft.Windows.Shell
|
|||||||
{
|
{
|
||||||
get
|
get
|
||||||
{
|
{
|
||||||
return (bool)base.GetValue(ThumbButtonInfo.IsInteractiveProperty);
|
return (bool) base.GetValue(ThumbButtonInfo.IsInteractiveProperty);
|
||||||
}
|
}
|
||||||
set
|
set
|
||||||
{
|
{
|
||||||
@@ -116,8 +116,8 @@ namespace Microsoft.Windows.Shell
|
|||||||
|
|
||||||
private void _OnCommandChanged(DependencyPropertyChangedEventArgs e)
|
private void _OnCommandChanged(DependencyPropertyChangedEventArgs e)
|
||||||
{
|
{
|
||||||
ICommand command = (ICommand)e.OldValue;
|
ICommand command = (ICommand) e.OldValue;
|
||||||
ICommand command2 = (ICommand)e.NewValue;
|
ICommand command2 = (ICommand) e.NewValue;
|
||||||
if (command == command2)
|
if (command == command2)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
@@ -136,7 +136,7 @@ namespace Microsoft.Windows.Shell
|
|||||||
{
|
{
|
||||||
get
|
get
|
||||||
{
|
{
|
||||||
return (bool)base.GetValue(ThumbButtonInfo._CanExecuteProperty);
|
return (bool) base.GetValue(ThumbButtonInfo._CanExecuteProperty);
|
||||||
}
|
}
|
||||||
set
|
set
|
||||||
{
|
{
|
||||||
@@ -188,7 +188,7 @@ namespace Microsoft.Windows.Shell
|
|||||||
|
|
||||||
private void _HookCommand(ICommand command)
|
private void _HookCommand(ICommand command)
|
||||||
{
|
{
|
||||||
this._commandEvent = delegate(object sender, EventArgs e)
|
this._commandEvent = delegate (object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
this._UpdateCanExecute();
|
this._UpdateCanExecute();
|
||||||
};
|
};
|
||||||
@@ -218,7 +218,7 @@ namespace Microsoft.Windows.Shell
|
|||||||
{
|
{
|
||||||
get
|
get
|
||||||
{
|
{
|
||||||
return (ICommand)base.GetValue(ThumbButtonInfo.CommandProperty);
|
return (ICommand) base.GetValue(ThumbButtonInfo.CommandProperty);
|
||||||
}
|
}
|
||||||
set
|
set
|
||||||
{
|
{
|
||||||
@@ -242,7 +242,7 @@ namespace Microsoft.Windows.Shell
|
|||||||
{
|
{
|
||||||
get
|
get
|
||||||
{
|
{
|
||||||
return (IInputElement)base.GetValue(ThumbButtonInfo.CommandTargetProperty);
|
return (IInputElement) base.GetValue(ThumbButtonInfo.CommandTargetProperty);
|
||||||
}
|
}
|
||||||
set
|
set
|
||||||
{
|
{
|
||||||
@@ -262,26 +262,26 @@ namespace Microsoft.Windows.Shell
|
|||||||
|
|
||||||
public static readonly DependencyProperty DescriptionProperty = DependencyProperty.Register("Description", typeof(string), typeof(ThumbButtonInfo), new PropertyMetadata(string.Empty, null, new CoerceValueCallback(ThumbButtonInfo._CoerceDescription)));
|
public static readonly DependencyProperty DescriptionProperty = DependencyProperty.Register("Description", typeof(string), typeof(ThumbButtonInfo), new PropertyMetadata(string.Empty, null, new CoerceValueCallback(ThumbButtonInfo._CoerceDescription)));
|
||||||
|
|
||||||
public static readonly DependencyProperty IsEnabledProperty = DependencyProperty.Register("IsEnabled", typeof(bool), typeof(ThumbButtonInfo), new PropertyMetadata(true, null, (DependencyObject d, object e) => ((ThumbButtonInfo)d)._CoerceIsEnabledValue(e)));
|
public static readonly DependencyProperty IsEnabledProperty = DependencyProperty.Register("IsEnabled", typeof(bool), typeof(ThumbButtonInfo), new PropertyMetadata(true, null, (DependencyObject d, object e) => ((ThumbButtonInfo) d)._CoerceIsEnabledValue(e)));
|
||||||
|
|
||||||
public static readonly DependencyProperty IsInteractiveProperty = DependencyProperty.Register("IsInteractive", typeof(bool), typeof(ThumbButtonInfo), new PropertyMetadata(true));
|
public static readonly DependencyProperty IsInteractiveProperty = DependencyProperty.Register("IsInteractive", typeof(bool), typeof(ThumbButtonInfo), new PropertyMetadata(true));
|
||||||
|
|
||||||
public static readonly DependencyProperty CommandProperty = DependencyProperty.Register("Command", typeof(ICommand), typeof(ThumbButtonInfo), new PropertyMetadata(null, delegate(DependencyObject d, DependencyPropertyChangedEventArgs e)
|
public static readonly DependencyProperty CommandProperty = DependencyProperty.Register("Command", typeof(ICommand), typeof(ThumbButtonInfo), new PropertyMetadata(null, delegate (DependencyObject d, DependencyPropertyChangedEventArgs e)
|
||||||
{
|
{
|
||||||
((ThumbButtonInfo)d)._OnCommandChanged(e);
|
((ThumbButtonInfo) d)._OnCommandChanged(e);
|
||||||
}));
|
}));
|
||||||
|
|
||||||
public static readonly DependencyProperty CommandParameterProperty = DependencyProperty.Register("CommandParameter", typeof(object), typeof(ThumbButtonInfo), new PropertyMetadata(null, delegate(DependencyObject d, DependencyPropertyChangedEventArgs e)
|
public static readonly DependencyProperty CommandParameterProperty = DependencyProperty.Register("CommandParameter", typeof(object), typeof(ThumbButtonInfo), new PropertyMetadata(null, delegate (DependencyObject d, DependencyPropertyChangedEventArgs e)
|
||||||
{
|
{
|
||||||
((ThumbButtonInfo)d)._UpdateCanExecute();
|
((ThumbButtonInfo) d)._UpdateCanExecute();
|
||||||
}));
|
}));
|
||||||
|
|
||||||
public static readonly DependencyProperty CommandTargetProperty = DependencyProperty.Register("CommandTarget", typeof(IInputElement), typeof(ThumbButtonInfo), new PropertyMetadata(null, delegate(DependencyObject d, DependencyPropertyChangedEventArgs e)
|
public static readonly DependencyProperty CommandTargetProperty = DependencyProperty.Register("CommandTarget", typeof(IInputElement), typeof(ThumbButtonInfo), new PropertyMetadata(null, delegate (DependencyObject d, DependencyPropertyChangedEventArgs e)
|
||||||
{
|
{
|
||||||
((ThumbButtonInfo)d)._UpdateCanExecute();
|
((ThumbButtonInfo) d)._UpdateCanExecute();
|
||||||
}));
|
}));
|
||||||
|
|
||||||
private static readonly DependencyProperty _CanExecuteProperty = DependencyProperty.Register("_CanExecute", typeof(bool), typeof(ThumbButtonInfo), new PropertyMetadata(true, delegate(DependencyObject d, DependencyPropertyChangedEventArgs e)
|
private static readonly DependencyProperty _CanExecuteProperty = DependencyProperty.Register("_CanExecute", typeof(bool), typeof(ThumbButtonInfo), new PropertyMetadata(true, delegate (DependencyObject d, DependencyPropertyChangedEventArgs e)
|
||||||
{
|
{
|
||||||
d.CoerceValue(ThumbButtonInfo.IsEnabledProperty);
|
d.CoerceValue(ThumbButtonInfo.IsEnabledProperty);
|
||||||
}));
|
}));
|
||||||
|
|||||||
@@ -24,8 +24,8 @@ namespace Microsoft.Windows.Shell
|
|||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
Window window = (Window)d;
|
Window window = (Window) d;
|
||||||
WindowChrome windowChrome = (WindowChrome)e.NewValue;
|
WindowChrome windowChrome = (WindowChrome) e.NewValue;
|
||||||
WindowChromeWorker windowChromeWorker = WindowChromeWorker.GetWindowChromeWorker(window);
|
WindowChromeWorker windowChromeWorker = WindowChromeWorker.GetWindowChromeWorker(window);
|
||||||
if (windowChromeWorker == null)
|
if (windowChromeWorker == null)
|
||||||
{
|
{
|
||||||
@@ -40,7 +40,7 @@ namespace Microsoft.Windows.Shell
|
|||||||
public static WindowChrome GetWindowChrome(Window window)
|
public static WindowChrome GetWindowChrome(Window window)
|
||||||
{
|
{
|
||||||
Verify.IsNotNull<Window>(window, "window");
|
Verify.IsNotNull<Window>(window, "window");
|
||||||
return (WindowChrome)window.GetValue(WindowChrome.WindowChromeProperty);
|
return (WindowChrome) window.GetValue(WindowChrome.WindowChromeProperty);
|
||||||
}
|
}
|
||||||
|
|
||||||
[SuppressMessage("Microsoft.Design", "CA1011:ConsiderPassingBaseTypesAsParameters")]
|
[SuppressMessage("Microsoft.Design", "CA1011:ConsiderPassingBaseTypesAsParameters")]
|
||||||
@@ -61,7 +61,7 @@ namespace Microsoft.Windows.Shell
|
|||||||
{
|
{
|
||||||
throw new ArgumentException("The element must be a DependencyObject", "inputElement");
|
throw new ArgumentException("The element must be a DependencyObject", "inputElement");
|
||||||
}
|
}
|
||||||
return (bool)dependencyObject.GetValue(WindowChrome.IsHitTestVisibleInChromeProperty);
|
return (bool) dependencyObject.GetValue(WindowChrome.IsHitTestVisibleInChromeProperty);
|
||||||
}
|
}
|
||||||
|
|
||||||
[SuppressMessage("Microsoft.Design", "CA1011:ConsiderPassingBaseTypesAsParameters")]
|
[SuppressMessage("Microsoft.Design", "CA1011:ConsiderPassingBaseTypesAsParameters")]
|
||||||
@@ -81,7 +81,7 @@ namespace Microsoft.Windows.Shell
|
|||||||
{
|
{
|
||||||
get
|
get
|
||||||
{
|
{
|
||||||
return (double)base.GetValue(WindowChrome.CaptionHeightProperty);
|
return (double) base.GetValue(WindowChrome.CaptionHeightProperty);
|
||||||
}
|
}
|
||||||
set
|
set
|
||||||
{
|
{
|
||||||
@@ -93,7 +93,7 @@ namespace Microsoft.Windows.Shell
|
|||||||
{
|
{
|
||||||
get
|
get
|
||||||
{
|
{
|
||||||
return (Thickness)base.GetValue(WindowChrome.ResizeBorderThicknessProperty);
|
return (Thickness) base.GetValue(WindowChrome.ResizeBorderThicknessProperty);
|
||||||
}
|
}
|
||||||
set
|
set
|
||||||
{
|
{
|
||||||
@@ -114,7 +114,7 @@ namespace Microsoft.Windows.Shell
|
|||||||
{
|
{
|
||||||
get
|
get
|
||||||
{
|
{
|
||||||
return (Thickness)base.GetValue(WindowChrome.GlassFrameThicknessProperty);
|
return (Thickness) base.GetValue(WindowChrome.GlassFrameThicknessProperty);
|
||||||
}
|
}
|
||||||
set
|
set
|
||||||
{
|
{
|
||||||
@@ -126,7 +126,7 @@ namespace Microsoft.Windows.Shell
|
|||||||
{
|
{
|
||||||
get
|
get
|
||||||
{
|
{
|
||||||
return (CornerRadius)base.GetValue(WindowChrome.CornerRadiusProperty);
|
return (CornerRadius) base.GetValue(WindowChrome.CornerRadiusProperty);
|
||||||
}
|
}
|
||||||
set
|
set
|
||||||
{
|
{
|
||||||
@@ -168,22 +168,22 @@ namespace Microsoft.Windows.Shell
|
|||||||
|
|
||||||
public static readonly DependencyProperty IsHitTestVisibleInChromeProperty = DependencyProperty.RegisterAttached("IsHitTestVisibleInChrome", typeof(bool), typeof(WindowChrome), new FrameworkPropertyMetadata(false, FrameworkPropertyMetadataOptions.Inherits));
|
public static readonly DependencyProperty IsHitTestVisibleInChromeProperty = DependencyProperty.RegisterAttached("IsHitTestVisibleInChrome", typeof(bool), typeof(WindowChrome), new FrameworkPropertyMetadata(false, FrameworkPropertyMetadataOptions.Inherits));
|
||||||
|
|
||||||
public static readonly DependencyProperty CaptionHeightProperty = DependencyProperty.Register("CaptionHeight", typeof(double), typeof(WindowChrome), new PropertyMetadata(0.0, delegate(DependencyObject d, DependencyPropertyChangedEventArgs e)
|
public static readonly DependencyProperty CaptionHeightProperty = DependencyProperty.Register("CaptionHeight", typeof(double), typeof(WindowChrome), new PropertyMetadata(0.0, delegate (DependencyObject d, DependencyPropertyChangedEventArgs e)
|
||||||
{
|
{
|
||||||
((WindowChrome)d)._OnPropertyChangedThatRequiresRepaint();
|
((WindowChrome) d)._OnPropertyChangedThatRequiresRepaint();
|
||||||
}), (object value) => (double)value >= 0.0);
|
}), (object value) => (double) value >= 0.0);
|
||||||
|
|
||||||
public static readonly DependencyProperty ResizeBorderThicknessProperty = DependencyProperty.Register("ResizeBorderThickness", typeof(Thickness), typeof(WindowChrome), new PropertyMetadata(default(Thickness)), (object value) => Utility.IsThicknessNonNegative((Thickness)value));
|
public static readonly DependencyProperty ResizeBorderThicknessProperty = DependencyProperty.Register("ResizeBorderThickness", typeof(Thickness), typeof(WindowChrome), new PropertyMetadata(default(Thickness)), (object value) => Utility.IsThicknessNonNegative((Thickness) value));
|
||||||
|
|
||||||
public static readonly DependencyProperty GlassFrameThicknessProperty = DependencyProperty.Register("GlassFrameThickness", typeof(Thickness), typeof(WindowChrome), new PropertyMetadata(default(Thickness), delegate(DependencyObject d, DependencyPropertyChangedEventArgs e)
|
public static readonly DependencyProperty GlassFrameThicknessProperty = DependencyProperty.Register("GlassFrameThickness", typeof(Thickness), typeof(WindowChrome), new PropertyMetadata(default(Thickness), delegate (DependencyObject d, DependencyPropertyChangedEventArgs e)
|
||||||
{
|
{
|
||||||
((WindowChrome)d)._OnPropertyChangedThatRequiresRepaint();
|
((WindowChrome) d)._OnPropertyChangedThatRequiresRepaint();
|
||||||
}, (DependencyObject d, object o) => WindowChrome._CoerceGlassFrameThickness((Thickness)o)));
|
}, (DependencyObject d, object o) => WindowChrome._CoerceGlassFrameThickness((Thickness) o)));
|
||||||
|
|
||||||
public static readonly DependencyProperty CornerRadiusProperty = DependencyProperty.Register("CornerRadius", typeof(CornerRadius), typeof(WindowChrome), new PropertyMetadata(default(CornerRadius), delegate(DependencyObject d, DependencyPropertyChangedEventArgs e)
|
public static readonly DependencyProperty CornerRadiusProperty = DependencyProperty.Register("CornerRadius", typeof(CornerRadius), typeof(WindowChrome), new PropertyMetadata(default(CornerRadius), delegate (DependencyObject d, DependencyPropertyChangedEventArgs e)
|
||||||
{
|
{
|
||||||
((WindowChrome)d)._OnPropertyChangedThatRequiresRepaint();
|
((WindowChrome) d)._OnPropertyChangedThatRequiresRepaint();
|
||||||
}), (object value) => Utility.IsCornerRadiusValid((CornerRadius)value));
|
}), (object value) => Utility.IsCornerRadiusValid((CornerRadius) value));
|
||||||
|
|
||||||
private static readonly List<WindowChrome._SystemParameterBoundProperty> _BoundProperties = new List<WindowChrome._SystemParameterBoundProperty>
|
private static readonly List<WindowChrome._SystemParameterBoundProperty> _BoundProperties = new List<WindowChrome._SystemParameterBoundProperty>
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -65,8 +65,8 @@ namespace Microsoft.Windows.Shell
|
|||||||
|
|
||||||
private static void _OnChromeWorkerChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
|
private static void _OnChromeWorkerChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
|
||||||
{
|
{
|
||||||
Window window = (Window)d;
|
Window window = (Window) d;
|
||||||
WindowChromeWorker windowChromeWorker = (WindowChromeWorker)e.NewValue;
|
WindowChromeWorker windowChromeWorker = (WindowChromeWorker) e.NewValue;
|
||||||
windowChromeWorker._SetWindow(window);
|
windowChromeWorker._SetWindow(window);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -92,7 +92,7 @@ namespace Microsoft.Windows.Shell
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
this._window.SourceInitialized += delegate(object sender, EventArgs e)
|
this._window.SourceInitialized += delegate (object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
this._hwnd = new WindowInteropHelper(this._window).Handle;
|
this._hwnd = new WindowInteropHelper(this._window).Handle;
|
||||||
this._hwndSource = HwndSource.FromHwnd(this._hwnd);
|
this._hwndSource = HwndSource.FromHwnd(this._hwnd);
|
||||||
@@ -122,7 +122,7 @@ namespace Microsoft.Windows.Shell
|
|||||||
public static WindowChromeWorker GetWindowChromeWorker(Window window)
|
public static WindowChromeWorker GetWindowChromeWorker(Window window)
|
||||||
{
|
{
|
||||||
Verify.IsNotNull<Window>(window, "window");
|
Verify.IsNotNull<Window>(window, "window");
|
||||||
return (WindowChromeWorker)window.GetValue(WindowChromeWorker.WindowChromeWorkerProperty);
|
return (WindowChromeWorker) window.GetValue(WindowChromeWorker.WindowChromeWorkerProperty);
|
||||||
}
|
}
|
||||||
|
|
||||||
[SuppressMessage("Microsoft.Design", "CA1011:ConsiderPassingBaseTypesAsParameters")]
|
[SuppressMessage("Microsoft.Design", "CA1011:ConsiderPassingBaseTypesAsParameters")]
|
||||||
@@ -177,11 +177,11 @@ namespace Microsoft.Windows.Shell
|
|||||||
this._window.Dispatcher.BeginInvoke(DispatcherPriority.Loaded, new WindowChromeWorker._Action(this._FixupFrameworkIssues));
|
this._window.Dispatcher.BeginInvoke(DispatcherPriority.Loaded, new WindowChromeWorker._Action(this._FixupFrameworkIssues));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
FrameworkElement frameworkElement = (FrameworkElement)VisualTreeHelper.GetChild(this._window, 0);
|
FrameworkElement frameworkElement = (FrameworkElement) VisualTreeHelper.GetChild(this._window, 0);
|
||||||
RECT windowRect = NativeMethods.GetWindowRect(this._hwnd);
|
RECT windowRect = NativeMethods.GetWindowRect(this._hwnd);
|
||||||
RECT rect = this._GetAdjustedWindowRect(windowRect);
|
RECT rect = this._GetAdjustedWindowRect(windowRect);
|
||||||
Rect rect2 = DpiHelper.DeviceRectToLogical(new Rect((double)windowRect.Left, (double)windowRect.Top, (double)windowRect.Width, (double)windowRect.Height));
|
Rect rect2 = DpiHelper.DeviceRectToLogical(new Rect((double) windowRect.Left, (double) windowRect.Top, (double) windowRect.Width, (double) windowRect.Height));
|
||||||
Rect rect3 = DpiHelper.DeviceRectToLogical(new Rect((double)rect.Left, (double)rect.Top, (double)rect.Width, (double)rect.Height));
|
Rect rect3 = DpiHelper.DeviceRectToLogical(new Rect((double) rect.Left, (double) rect.Top, (double) rect.Width, (double) rect.Height));
|
||||||
Thickness thickness = new Thickness(rect2.Left - rect3.Left, rect2.Top - rect3.Top, rect3.Right - rect2.Right, rect3.Bottom - rect2.Bottom);
|
Thickness thickness = new Thickness(rect2.Left - rect3.Left, rect2.Top - rect3.Top, rect3.Right - rect2.Right, rect3.Bottom - rect2.Bottom);
|
||||||
frameworkElement.Margin = new Thickness(0.0, 0.0, -(thickness.Left + thickness.Right), -(thickness.Top + thickness.Bottom));
|
frameworkElement.Margin = new Thickness(0.0, 0.0, -(thickness.Left + thickness.Right), -(thickness.Top + thickness.Bottom));
|
||||||
if (this._window.FlowDirection == FlowDirection.RightToLeft)
|
if (this._window.FlowDirection == FlowDirection.RightToLeft)
|
||||||
@@ -238,7 +238,7 @@ namespace Microsoft.Windows.Shell
|
|||||||
Bottom = 100,
|
Bottom = 100,
|
||||||
Right = 100
|
Right = 100
|
||||||
});
|
});
|
||||||
Point point = DpiHelper.DevicePixelsToLogical(new Point((double)(windowPlacement.rcNormalPosition.Left - rect.Left), (double)(windowPlacement.rcNormalPosition.Top - rect.Top)));
|
Point point = DpiHelper.DevicePixelsToLogical(new Point((double) (windowPlacement.rcNormalPosition.Left - rect.Left), (double) (windowPlacement.rcNormalPosition.Top - rect.Top)));
|
||||||
this._window.Top = point.Y;
|
this._window.Top = point.Y;
|
||||||
this._window.Left = point.X;
|
this._window.Left = point.X;
|
||||||
}
|
}
|
||||||
@@ -246,8 +246,8 @@ namespace Microsoft.Windows.Shell
|
|||||||
|
|
||||||
private RECT _GetAdjustedWindowRect(RECT rcWindow)
|
private RECT _GetAdjustedWindowRect(RECT rcWindow)
|
||||||
{
|
{
|
||||||
WS dwStyle = (WS)((int)NativeMethods.GetWindowLongPtr(this._hwnd, GWL.STYLE));
|
WS dwStyle = (WS) ((int) NativeMethods.GetWindowLongPtr(this._hwnd, GWL.STYLE));
|
||||||
WS_EX dwExStyle = (WS_EX)((int)NativeMethods.GetWindowLongPtr(this._hwnd, GWL.EXSTYLE));
|
WS_EX dwExStyle = (WS_EX) ((int) NativeMethods.GetWindowLongPtr(this._hwnd, GWL.EXSTYLE));
|
||||||
return NativeMethods.AdjustWindowRectEx(rcWindow, dwStyle, false, dwExStyle);
|
return NativeMethods.AdjustWindowRectEx(rcWindow, dwStyle, false, dwExStyle);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -265,7 +265,7 @@ namespace Microsoft.Windows.Shell
|
|||||||
Right = 100
|
Right = 100
|
||||||
});
|
});
|
||||||
Point point = new Point(this._window.Left, this._window.Top);
|
Point point = new Point(this._window.Left, this._window.Top);
|
||||||
point -= (Vector)DpiHelper.DevicePixelsToLogical(new Point((double)rect.Left, (double)rect.Top));
|
point -= (Vector) DpiHelper.DevicePixelsToLogical(new Point((double) rect.Left, (double) rect.Top));
|
||||||
return this._window.RestoreBounds.Location != point;
|
return this._window.RestoreBounds.Location != point;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -274,9 +274,9 @@ namespace Microsoft.Windows.Shell
|
|||||||
{
|
{
|
||||||
foreach (KeyValuePair<WM, MessageHandler> keyValuePair in this._messageTable)
|
foreach (KeyValuePair<WM, MessageHandler> keyValuePair in this._messageTable)
|
||||||
{
|
{
|
||||||
if (keyValuePair.Key == (WM)msg)
|
if (keyValuePair.Key == (WM) msg)
|
||||||
{
|
{
|
||||||
return keyValuePair.Value((WM)msg, wParam, lParam, out handled);
|
return keyValuePair.Value((WM) msg, wParam, lParam, out handled);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return IntPtr.Zero;
|
return IntPtr.Zero;
|
||||||
@@ -317,7 +317,7 @@ namespace Microsoft.Windows.Shell
|
|||||||
}
|
}
|
||||||
if (IntPtr.Zero == intPtr)
|
if (IntPtr.Zero == intPtr)
|
||||||
{
|
{
|
||||||
Point point = new Point((double)Utility.GET_X_LPARAM(lParam), (double)Utility.GET_Y_LPARAM(lParam));
|
Point point = new Point((double) Utility.GET_X_LPARAM(lParam), (double) Utility.GET_Y_LPARAM(lParam));
|
||||||
Rect deviceRectangle = this._GetWindowRect();
|
Rect deviceRectangle = this._GetWindowRect();
|
||||||
HT ht = this._HitTestNca(DpiHelper.DeviceRectToLogical(deviceRectangle), DpiHelper.DevicePixelsToLogical(point));
|
HT ht = this._HitTestNca(DpiHelper.DeviceRectToLogical(deviceRectangle), DpiHelper.DevicePixelsToLogical(point));
|
||||||
if (ht != HT.CLIENT)
|
if (ht != HT.CLIENT)
|
||||||
@@ -332,7 +332,7 @@ namespace Microsoft.Windows.Shell
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
handled = true;
|
handled = true;
|
||||||
intPtr = new IntPtr((int)ht);
|
intPtr = new IntPtr((int) ht);
|
||||||
}
|
}
|
||||||
return intPtr;
|
return intPtr;
|
||||||
}
|
}
|
||||||
@@ -341,7 +341,7 @@ namespace Microsoft.Windows.Shell
|
|||||||
{
|
{
|
||||||
if (2 == wParam.ToInt32())
|
if (2 == wParam.ToInt32())
|
||||||
{
|
{
|
||||||
SystemCommands.ShowSystemMenuPhysicalCoordinates(this._window, new Point((double)Utility.GET_X_LPARAM(lParam), (double)Utility.GET_Y_LPARAM(lParam)));
|
SystemCommands.ShowSystemMenuPhysicalCoordinates(this._window, new Point((double) Utility.GET_X_LPARAM(lParam), (double) Utility.GET_Y_LPARAM(lParam)));
|
||||||
}
|
}
|
||||||
handled = false;
|
handled = false;
|
||||||
return IntPtr.Zero;
|
return IntPtr.Zero;
|
||||||
@@ -364,7 +364,7 @@ namespace Microsoft.Windows.Shell
|
|||||||
this._UpdateSystemMenu(null);
|
this._UpdateSystemMenu(null);
|
||||||
if (!this._isGlassEnabled)
|
if (!this._isGlassEnabled)
|
||||||
{
|
{
|
||||||
WINDOWPOS value = (WINDOWPOS)Marshal.PtrToStructure(lParam, typeof(WINDOWPOS));
|
WINDOWPOS value = (WINDOWPOS) Marshal.PtrToStructure(lParam, typeof(WINDOWPOS));
|
||||||
this._SetRoundingRegion(new WINDOWPOS?(value));
|
this._SetRoundingRegion(new WINDOWPOS?(value));
|
||||||
}
|
}
|
||||||
handled = false;
|
handled = false;
|
||||||
@@ -420,13 +420,13 @@ namespace Microsoft.Windows.Shell
|
|||||||
|
|
||||||
private bool _ModifyStyle(WS removeStyle, WS addStyle)
|
private bool _ModifyStyle(WS removeStyle, WS addStyle)
|
||||||
{
|
{
|
||||||
WS ws = (WS)NativeMethods.GetWindowLongPtr(this._hwnd, GWL.STYLE).ToInt32();
|
WS ws = (WS) NativeMethods.GetWindowLongPtr(this._hwnd, GWL.STYLE).ToInt32();
|
||||||
WS ws2 = (ws & ~removeStyle) | addStyle;
|
WS ws2 = (ws & ~removeStyle) | addStyle;
|
||||||
if (ws == ws2)
|
if (ws == ws2)
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
NativeMethods.SetWindowLongPtr(this._hwnd, GWL.STYLE, new IntPtr((int)ws2));
|
NativeMethods.SetWindowLongPtr(this._hwnd, GWL.STYLE, new IntPtr((int) ws2));
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -447,7 +447,7 @@ namespace Microsoft.Windows.Shell
|
|||||||
private Rect _GetWindowRect()
|
private Rect _GetWindowRect()
|
||||||
{
|
{
|
||||||
RECT windowRect = NativeMethods.GetWindowRect(this._hwnd);
|
RECT windowRect = NativeMethods.GetWindowRect(this._hwnd);
|
||||||
return new Rect((double)windowRect.Left, (double)windowRect.Top, (double)windowRect.Width, (double)windowRect.Height);
|
return new Rect((double) windowRect.Left, (double) windowRect.Top, (double) windowRect.Width, (double) windowRect.Height);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void _UpdateSystemMenu(WindowState? assumeState)
|
private void _UpdateSystemMenu(WindowState? assumeState)
|
||||||
@@ -460,10 +460,10 @@ namespace Microsoft.Windows.Shell
|
|||||||
IntPtr systemMenu = NativeMethods.GetSystemMenu(this._hwnd, false);
|
IntPtr systemMenu = NativeMethods.GetSystemMenu(this._hwnd, false);
|
||||||
if (IntPtr.Zero != systemMenu)
|
if (IntPtr.Zero != systemMenu)
|
||||||
{
|
{
|
||||||
WS value = (WS)NativeMethods.GetWindowLongPtr(this._hwnd, GWL.STYLE).ToInt32();
|
WS value = (WS) NativeMethods.GetWindowLongPtr(this._hwnd, GWL.STYLE).ToInt32();
|
||||||
bool flag2 = Utility.IsFlagSet((int)value, 131072);
|
bool flag2 = Utility.IsFlagSet((int) value, 131072);
|
||||||
bool flag3 = Utility.IsFlagSet((int)value, 65536);
|
bool flag3 = Utility.IsFlagSet((int) value, 65536);
|
||||||
bool flag4 = Utility.IsFlagSet((int)value, 262144);
|
bool flag4 = Utility.IsFlagSet((int) value, 262144);
|
||||||
switch (windowState)
|
switch (windowState)
|
||||||
{
|
{
|
||||||
case WindowState.Minimized:
|
case WindowState.Minimized:
|
||||||
@@ -540,8 +540,8 @@ namespace Microsoft.Windows.Shell
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
Rect rect = this._GetWindowRect();
|
Rect rect = this._GetWindowRect();
|
||||||
num = (int)rect.Left;
|
num = (int) rect.Left;
|
||||||
num2 = (int)rect.Top;
|
num2 = (int) rect.Top;
|
||||||
}
|
}
|
||||||
IntPtr hMonitor = NativeMethods.MonitorFromWindow(this._hwnd, 2u);
|
IntPtr hMonitor = NativeMethods.MonitorFromWindow(this._hwnd, 2u);
|
||||||
MONITORINFO monitorInfo = NativeMethods.GetMonitorInfo(hMonitor);
|
MONITORINFO monitorInfo = NativeMethods.GetMonitorInfo(hMonitor);
|
||||||
@@ -563,7 +563,7 @@ namespace Microsoft.Windows.Shell
|
|||||||
Size size;
|
Size size;
|
||||||
if (wp != null && !Utility.IsFlagSet(wp.Value.flags, 1))
|
if (wp != null && !Utility.IsFlagSet(wp.Value.flags, 1))
|
||||||
{
|
{
|
||||||
size = new Size((double)wp.Value.cx, (double)wp.Value.cy);
|
size = new Size((double) wp.Value.cx, (double) wp.Value.cy);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -616,9 +616,9 @@ namespace Microsoft.Windows.Shell
|
|||||||
{
|
{
|
||||||
if (DoubleUtilities.AreClose(0.0, radius))
|
if (DoubleUtilities.AreClose(0.0, radius))
|
||||||
{
|
{
|
||||||
return NativeMethods.CreateRectRgn((int)Math.Floor(region.Left), (int)Math.Floor(region.Top), (int)Math.Ceiling(region.Right), (int)Math.Ceiling(region.Bottom));
|
return NativeMethods.CreateRectRgn((int) Math.Floor(region.Left), (int) Math.Floor(region.Top), (int) Math.Ceiling(region.Right), (int) Math.Ceiling(region.Bottom));
|
||||||
}
|
}
|
||||||
return NativeMethods.CreateRoundRectRgn((int)Math.Floor(region.Left), (int)Math.Floor(region.Top), (int)Math.Ceiling(region.Right) + 1, (int)Math.Ceiling(region.Bottom) + 1, (int)Math.Ceiling(radius), (int)Math.Ceiling(radius));
|
return NativeMethods.CreateRoundRectRgn((int) Math.Floor(region.Left), (int) Math.Floor(region.Top), (int) Math.Ceiling(region.Right) + 1, (int) Math.Ceiling(region.Bottom) + 1, (int) Math.Ceiling(radius), (int) Math.Ceiling(radius));
|
||||||
}
|
}
|
||||||
|
|
||||||
[SuppressMessage("Microsoft.Naming", "CA2204:Literals should be spelled correctly", MessageId = "HRGNs")]
|
[SuppressMessage("Microsoft.Naming", "CA2204:Literals should be spelled correctly", MessageId = "HRGNs")]
|
||||||
@@ -665,10 +665,10 @@ namespace Microsoft.Windows.Shell
|
|||||||
Point point2 = DpiHelper.LogicalPixelsToDevice(new Point(this._chromeInfo.GlassFrameThickness.Right, this._chromeInfo.GlassFrameThickness.Bottom));
|
Point point2 = DpiHelper.LogicalPixelsToDevice(new Point(this._chromeInfo.GlassFrameThickness.Right, this._chromeInfo.GlassFrameThickness.Bottom));
|
||||||
MARGINS margins = new MARGINS
|
MARGINS margins = new MARGINS
|
||||||
{
|
{
|
||||||
cxLeftWidth = (int)Math.Ceiling(point.X),
|
cxLeftWidth = (int) Math.Ceiling(point.X),
|
||||||
cxRightWidth = (int)Math.Ceiling(point2.X),
|
cxRightWidth = (int) Math.Ceiling(point2.X),
|
||||||
cyTopHeight = (int)Math.Ceiling(point.Y),
|
cyTopHeight = (int) Math.Ceiling(point.Y),
|
||||||
cyBottomHeight = (int)Math.Ceiling(point2.Y)
|
cyBottomHeight = (int) Math.Ceiling(point2.Y)
|
||||||
};
|
};
|
||||||
NativeMethods.DwmExtendFrameIntoClientArea(this._hwnd, ref margins);
|
NativeMethods.DwmExtendFrameIntoClientArea(this._hwnd, ref margins);
|
||||||
}
|
}
|
||||||
@@ -683,11 +683,11 @@ namespace Microsoft.Windows.Shell
|
|||||||
flag = (mousePosition.Y < windowPosition.Top + this._chromeInfo.ResizeBorderThickness.Top);
|
flag = (mousePosition.Y < windowPosition.Top + this._chromeInfo.ResizeBorderThickness.Top);
|
||||||
num = 0;
|
num = 0;
|
||||||
}
|
}
|
||||||
else if (mousePosition.Y < windowPosition.Bottom && mousePosition.Y >= windowPosition.Bottom - (double)((int)this._chromeInfo.ResizeBorderThickness.Bottom))
|
else if (mousePosition.Y < windowPosition.Bottom && mousePosition.Y >= windowPosition.Bottom - (double) ((int) this._chromeInfo.ResizeBorderThickness.Bottom))
|
||||||
{
|
{
|
||||||
num = 2;
|
num = 2;
|
||||||
}
|
}
|
||||||
if (mousePosition.X >= windowPosition.Left && mousePosition.X < windowPosition.Left + (double)((int)this._chromeInfo.ResizeBorderThickness.Left))
|
if (mousePosition.X >= windowPosition.Left && mousePosition.X < windowPosition.Left + (double) ((int) this._chromeInfo.ResizeBorderThickness.Left))
|
||||||
{
|
{
|
||||||
num2 = 0;
|
num2 = 0;
|
||||||
}
|
}
|
||||||
@@ -733,7 +733,7 @@ namespace Microsoft.Windows.Shell
|
|||||||
{
|
{
|
||||||
if (Utility.IsPresentationFrameworkVersionLessThan4)
|
if (Utility.IsPresentationFrameworkVersionLessThan4)
|
||||||
{
|
{
|
||||||
FrameworkElement frameworkElement = (FrameworkElement)VisualTreeHelper.GetChild(this._window, 0);
|
FrameworkElement frameworkElement = (FrameworkElement) VisualTreeHelper.GetChild(this._window, 0);
|
||||||
frameworkElement.Margin = default(Thickness);
|
frameworkElement.Margin = default(Thickness);
|
||||||
this._window.StateChanged -= this._FixupRestoreBounds;
|
this._window.StateChanged -= this._FixupRestoreBounds;
|
||||||
this._isFixedUp = false;
|
this._isFixedUp = false;
|
||||||
|
|||||||
Reference in new issue
Block a user