Merge pull request #558 from HandyOrg/t/bot/fix-codeformatting

[Bot] Automated PR to fix formatting errors
This commit is contained in:
NaBian 2020-12-06 11:27:43 +08:00 committed by GitHub
commit 9b1c63b70b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
156 changed files with 8279 additions and 8279 deletions

View File

@ -250,7 +250,7 @@ namespace Microsoft.Windows.Shell
}
Guid guid = new Guid("92CA9DCD-5622-4bba-A805-5E9F541BD8C9");
uint num;
IObjectArray shellObjects = (IObjectArray)customDestinationList.BeginList(out num, ref guid);
IObjectArray shellObjects = (IObjectArray) customDestinationList.BeginList(out num, ref guid);
removedList = JumpList.GenerateJumpItems(shellObjects);
successList = new List<JumpItem>(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)
{
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;
}
@ -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)
{
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)
{
objectCollection.AddObject(shellObjectPair.ShellObject);
@ -523,7 +523,7 @@ namespace Microsoft.Windows.Shell
{
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;
try
{
@ -546,7 +546,7 @@ namespace Microsoft.Windows.Shell
string pszIconPath = JumpList._FullName;
if (!string.IsNullOrEmpty(jumpTask.IconResourcePath))
{
if ((long)jumpTask.IconResourcePath.Length >= 260L)
if ((long) jumpTask.IconResourcePath.Length >= 260L)
{
return null;
}
@ -558,7 +558,7 @@ namespace Microsoft.Windows.Shell
{
shellLinkW.SetDescription(jumpTask.Description);
}
IPropertyStore propertyStore = (IPropertyStore)shellLinkW;
IPropertyStore propertyStore = (IPropertyStore) shellLinkW;
using (PROPVARIANT propvariant = new PROPVARIANT())
{
PKEY pkey = default(PKEY);
@ -599,13 +599,13 @@ namespace Microsoft.Windows.Shell
Guid guid = new Guid("7e9fb0d3-919f-4307-ab2e-9b1860310c93");
object 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;
obj = null;
}
hrLeft.ThrowIfFailed();
return (IShellItem2)obj;
return (IShellItem2) obj;
}
[SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes")]
@ -629,7 +629,7 @@ namespace Microsoft.Windows.Shell
{
return new JumpPath
{
Path = shellItem.GetDisplayName((SIGDN)2147647488u)
Path = shellItem.GetDisplayName((SIGDN) 2147647488u)
};
}
if (shellLinkW != null)
@ -656,7 +656,7 @@ namespace Microsoft.Windows.Shell
};
using (PROPVARIANT propvariant = new PROPVARIANT())
{
IPropertyStore propertyStore = (IPropertyStore)shellLinkW;
IPropertyStore propertyStore = (IPropertyStore) shellLinkW;
PKEY title = PKEY.Title;
propertyStore.GetValue(ref title, propvariant);
jumpTask.Title = (propvariant.GetValue() ?? "");
@ -673,7 +673,7 @@ namespace Microsoft.Windows.Shell
string text = null;
using (PROPVARIANT propvariant = new PROPVARIANT())
{
IPropertyStore propertyStore = (IPropertyStore)shellLink;
IPropertyStore propertyStore = (IPropertyStore) shellLink;
PKEY title = PKEY.Title;
propertyStore.GetValue(ref title, propvariant);
text = (propvariant.GetValue() ?? "");

View File

@ -6,7 +6,7 @@ namespace Standard
{
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";

View File

@ -15,9 +15,9 @@ namespace Standard
int deviceCaps = NativeMethods.GetDeviceCaps(desktop, DeviceCap.LOGPIXELSX);
int deviceCaps2 = NativeMethods.GetDeviceCaps(desktop, DeviceCap.LOGPIXELSY);
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.Scale((double)deviceCaps / 96.0, (double)deviceCaps2 / 96.0);
DpiHelper._transformToDevice.Scale((double) deviceCaps / 96.0, (double) deviceCaps2 / 96.0);
}
}

View File

@ -17,27 +17,27 @@ namespace Standard
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
{
get
{
return HRESULT.GetFacility((int)this._value);
return HRESULT.GetFacility((int) this._value);
}
}
public static Facility GetFacility(int errorCode)
{
return (Facility)(errorCode >> 16 & 8191);
return (Facility) (errorCode >> 16 & 8191);
}
public int Code
{
get
{
return HRESULT.GetCode((int)this._value);
return HRESULT.GetCode((int) this._value);
}
}
@ -52,7 +52,7 @@ namespace Standard
{
if (fieldInfo.FieldType == typeof(HRESULT))
{
HRESULT hrLeft = (HRESULT)fieldInfo.GetValue(null);
HRESULT hrLeft = (HRESULT) fieldInfo.GetValue(null);
if (hrLeft == this)
{
return fieldInfo.Name;
@ -65,8 +65,8 @@ namespace Standard
{
if (fieldInfo2.FieldType == typeof(Win32Error))
{
Win32Error error = (Win32Error)fieldInfo2.GetValue(null);
if ((HRESULT)error == this)
Win32Error error = (Win32Error) fieldInfo2.GetValue(null);
if ((HRESULT) error == this)
{
return "HRESULT_FROM_WIN32(" + fieldInfo2.Name + ")";
}
@ -84,7 +84,7 @@ namespace Standard
bool result;
try
{
result = (((HRESULT)obj)._value == this._value);
result = (((HRESULT) obj)._value == this._value);
}
catch (InvalidCastException)
{
@ -139,7 +139,7 @@ namespace Standard
{
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))
{
Facility facility = this.Facility;
@ -149,7 +149,7 @@ namespace Standard
}
else
{
ex = new COMException(message, (int)this._value);
ex = new COMException(message, (int) this._value);
}
}
else
@ -172,7 +172,7 @@ namespace Standard
public static void ThrowLastError()
{
((HRESULT)Win32Error.GetLastError()).ThrowIfFailed();
((HRESULT) Win32Error.GetLastError()).ThrowIfFailed();
}
[FieldOffset(0)]

View File

@ -8,7 +8,7 @@ namespace Standard
[ComImport]
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);

View File

@ -8,7 +8,7 @@ namespace Standard
[ComImport]
internal interface ICustomDestinationList
{
void SetAppID([MarshalAs(UnmanagedType.LPWStr)] [In] string pszAppID);
void SetAppID([MarshalAs(UnmanagedType.LPWStr)][In] string pszAppID);
[return: MarshalAs(UnmanagedType.Interface)]
object BeginList(out uint pcMaxSlots, [In] ref Guid riid);

View File

@ -8,7 +8,7 @@ namespace Standard
[ComImport]
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);

View File

@ -12,7 +12,7 @@ namespace Standard
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);

View File

@ -9,7 +9,7 @@ namespace Standard
[ComImport]
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);
@ -25,13 +25,13 @@ namespace Standard
[return: MarshalAs(UnmanagedType.Interface)]
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)]
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 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);
}
}

View File

@ -9,21 +9,21 @@ namespace Standard
[ComImport]
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 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 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 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);
@ -35,7 +35,7 @@ namespace Standard
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);

View File

@ -45,7 +45,7 @@ namespace Standard
byte[] array = new byte[4096];
long num;
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);
if (num2 == 0)
@ -93,7 +93,7 @@ namespace Standard
public void Seek(long dlibMove, int dwOrigin, IntPtr plibNewPosition)
{
this._Validate();
long val = this._source.Seek(dlibMove, (SeekOrigin)dwOrigin);
long val = this._source.Seek(dlibMove, (SeekOrigin) dwOrigin);
if (IntPtr.Zero != plibNewPosition)
{
Marshal.WriteInt64(plibNewPosition, val);

View File

@ -31,8 +31,8 @@ namespace Standard
try
{
value = GCHandle.Alloc(this);
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);
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);
}
finally
{
@ -88,7 +88,7 @@ namespace Standard
MessageWindow messageWindow = null;
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);
}
else if (!MessageWindow.s_windowLookup.TryGetValue(hwnd, out messageWindow))

View File

@ -32,7 +32,7 @@ namespace Standard
[SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
[DllImport("user32.dll", EntryPoint = "ChangeWindowMessageFilterEx", SetLastError = true)]
[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")]
public static HRESULT ChangeWindowMessageFilterEx(IntPtr hwnd, WM message, MSGFLT action, out MSGFLTINFO filterInfo)
@ -46,7 +46,7 @@ namespace Standard
{
if (!NativeMethods._ChangeWindowMessageFilter(message, action))
{
return (HRESULT)Win32Error.GetLastError();
return (HRESULT) Win32Error.GetLastError();
}
return HRESULT.S_OK;
}
@ -54,11 +54,11 @@ namespace Standard
{
CHANGEFILTERSTRUCT changefilterstruct = new CHANGEFILTERSTRUCT
{
cbSize = (uint)Marshal.SizeOf(typeof(CHANGEFILTERSTRUCT))
cbSize = (uint) Marshal.SizeOf(typeof(CHANGEFILTERSTRUCT))
};
if (!NativeMethods._ChangeWindowMessageFilterEx(hwnd, message, action, ref changefilterstruct))
{
return (HRESULT)Win32Error.GetLastError();
return (HRESULT) Win32Error.GetLastError();
}
filterInfo = changefilterstruct.ExtStatus;
return HRESULT.S_OK;
@ -258,7 +258,7 @@ namespace Standard
[SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
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);
}
@ -276,7 +276,7 @@ namespace Standard
[SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
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")]
@ -287,7 +287,7 @@ namespace Standard
[SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
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();
}
@ -315,12 +315,12 @@ namespace Standard
[SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
[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")]
[DllImport("kernel32.dll", SetLastError = true)]
[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")]
[DllImport("user32.dll", EntryPoint = "GetClientRect", SetLastError = true)]
@ -374,7 +374,7 @@ namespace Standard
public static string GetModuleFileName(IntPtr hModule)
{
StringBuilder stringBuilder = new StringBuilder(260);
for (;;)
for (; ; )
{
int num = NativeMethods._GetModuleFileName(hModule, stringBuilder, stringBuilder.Capacity);
if (num == 0)
@ -406,7 +406,7 @@ namespace Standard
[SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
[DllImport("user32.dll", EntryPoint = "GetMonitorInfo", SetLastError = true)]
[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")]
public static MONITORINFO GetMonitorInfo(IntPtr hMonitor)
@ -581,7 +581,7 @@ namespace Standard
{
HRESULT.ThrowLastError();
}
return (WM)num;
return (WM) num;
}
[SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
@ -698,12 +698,12 @@ namespace Standard
[SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
[DllImport("user32.dll", CharSet = CharSet.Unicode, EntryPoint = "SystemParametersInfoW", SetLastError = true)]
[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")]
[DllImport("user32.dll", CharSet = CharSet.Unicode, EntryPoint = "SystemParametersInfoW", SetLastError = true)]
[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")]
public static void SystemParametersInfo(SPI uiAction, int uiParam, string pvParam, SPIF fWinIni)
@ -792,7 +792,7 @@ namespace Standard
[SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
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();
}

View File

@ -13,7 +13,7 @@ namespace Standard
{
get
{
return (VarEnum)this.vt;
return (VarEnum) this.vt;
}
}
@ -31,7 +31,7 @@ namespace Standard
{
this.Clear();
this.vt = 11;
this.boolVal = (short)(f ? -1 : 0);
this.boolVal = (short) (f ? -1 : 0);
}
[SuppressMessage("Microsoft.Security", "CA2122:DoNotIndirectlyExposeMethodsWithLinkDemands")]

View File

@ -126,7 +126,7 @@ namespace Standard
bool result;
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);
}
catch (InvalidCastException)

View File

@ -20,7 +20,7 @@ namespace Standard
private static bool _MemCmp(IntPtr left, IntPtr right, long cb)
{
int num = 0;
while ((long)num < cb - 8L)
while ((long) num < cb - 8L)
{
long num2 = Marshal.ReadInt64(left, num);
long num3 = Marshal.ReadInt64(right, num);
@ -30,7 +30,7 @@ namespace Standard
}
num += 8;
}
while ((long)num < cb)
while ((long) num < cb)
{
byte b = Marshal.ReadByte(left, num);
byte b2 = Marshal.ReadByte(right, num);
@ -46,12 +46,12 @@ namespace Standard
[SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
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)
{
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")]
@ -69,13 +69,13 @@ namespace Standard
[SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
public static int HIWORD(int i)
{
return (int)((short)(i >> 16));
return (int) ((short) (i >> 16));
}
[SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
public static int LOWORD(int i)
{
return (int)((short)(i & 65535));
return (int) ((short) (i & 65535));
}
[SuppressMessage("Microsoft.Security", "CA2122:DoNotIndirectlyExposeMethodsWithLinkDemands")]
@ -98,7 +98,7 @@ namespace Standard
{
return false;
}
int num = (int)left.Length;
int num = (int) left.Length;
left.Position = 0L;
right.Position = 0L;
int i = 0;
@ -120,7 +120,7 @@ namespace Standard
{
return false;
}
if (!Utility._MemCmp(left2, right2, (long)num3))
if (!Utility._MemCmp(left2, right2, (long) num3))
{
return false;
}
@ -217,7 +217,7 @@ namespace Standard
BitmapFrame bitmapFrame = image as BitmapFrame;
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
{
@ -242,7 +242,7 @@ namespace Standard
DrawingContext drawingContext = drawingVisual.RenderOpen();
drawingContext.DrawImage(image, rectangle);
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);
bitmapFrame = BitmapFrame.Create(renderTargetBitmap);
}
@ -543,7 +543,7 @@ namespace Standard
IntPtr left2 = gchandle.AddrOfPinnedObject();
GCHandle gchandle2 = GCHandle.Alloc(right, GCHandleType.Pinned);
IntPtr right2 = gchandle2.AddrOfPinnedObject();
bool result = Utility._MemCmp(left2, right2, (long)cb);
bool result = Utility._MemCmp(left2, right2, (long) cb);
gchandle.Free();
gchandle2.Free();
return result;
@ -577,7 +577,7 @@ namespace Standard
int num4 = Utility._HexToInt(url[i + 5]);
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;
goto IL_12D;
}
@ -588,7 +588,7 @@ namespace Standard
int num6 = Utility._HexToInt(url[i + 2]);
if (num5 >= 0 && num6 >= 0)
{
urlDecoder.AddByte((byte)(num5 << 4 | num6));
urlDecoder.AddByte((byte) (num5 << 4 | num6));
i += 2;
goto IL_12D;
}
@ -596,14 +596,14 @@ namespace Standard
}
if ((c & 'タ') == '\0')
{
urlDecoder.AddByte((byte)c);
urlDecoder.AddByte((byte) c);
}
else
{
urlDecoder.AddChar(c);
}
}
IL_12D:;
IL_12D:;
}
return urlDecoder.GetString();
}
@ -648,7 +648,7 @@ namespace Standard
{
array3[num2++] = 37;
array3[num2++] = Utility._IntToHex(b2 >> 4 & 15);
array3[num2++] = Utility._IntToHex((int)(b2 & 15));
array3[num2++] = Utility._IntToHex((int) (b2 & 15));
}
}
array = array3;
@ -700,9 +700,9 @@ namespace Standard
{
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")]
@ -710,15 +710,15 @@ namespace Standard
{
if (h >= '0' && h <= '9')
{
return (int)(h - '0');
return (int) (h - '0');
}
if (h >= 'a' && h <= 'f')
{
return (int)(h - 'a' + '\n');
return (int) (h - 'a' + '\n');
}
if (h >= 'A' && h <= 'F')
{
return (int)(h - 'A' + '\n');
return (int) (h - 'A' + '\n');
}
return -1;
}

View File

@ -16,14 +16,14 @@ namespace Standard
{
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);
}
public HRESULT ToHRESULT()
{
return (HRESULT)this;
return (HRESULT) this;
}
[SuppressMessage("Microsoft.Security", "CA2122:DoNotIndirectlyExposeMethodsWithLinkDemands")]
@ -37,7 +37,7 @@ namespace Standard
bool result;
try
{
result = (((Win32Error)obj)._value == this._value);
result = (((Win32Error) obj)._value == this._value);
}
catch (InvalidCastException)
{

View File

@ -25,7 +25,7 @@ namespace Microsoft.Windows.Shell
{
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)
@ -67,10 +67,10 @@ namespace Microsoft.Windows.Shell
return;
}
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)
{
NativeMethods.PostMessage(handle, WM.SYSCOMMAND, new IntPtr((long)((ulong)num)), IntPtr.Zero);
NativeMethods.PostMessage(handle, WM.SYSCOMMAND, new IntPtr((long) ((ulong) num)), IntPtr.Zero);
}
}
}

View File

@ -38,7 +38,7 @@ namespace Microsoft.Windows.Shell
private void _UpdateGlassColor(IntPtr wParam, IntPtr lParam)
{
bool flag = lParam != IntPtr.Zero;
uint num = (uint)((int)wParam.ToInt64());
uint num = (uint) ((int) wParam.ToInt64());
num |= (flag ? 4278190080u : 0u);
this.WindowGlassColor = Utility.ColorFromArgbDword(num);
SolidColorBrush solidColorBrush = new SolidColorBrush(this.WindowGlassColor);
@ -48,7 +48,7 @@ namespace Microsoft.Windows.Shell
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;
}
@ -59,7 +59,7 @@ namespace Microsoft.Windows.Shell
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);
this.WindowResizeBorderThickness = new Thickness(size.Width, size.Height, size.Width, size.Height);
}
@ -71,10 +71,10 @@ namespace Microsoft.Windows.Shell
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);
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);
}
@ -85,7 +85,7 @@ namespace Microsoft.Windows.Shell
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)
@ -99,8 +99,8 @@ namespace Microsoft.Windows.Shell
int systemMetrics2 = NativeMethods.GetSystemMetrics(SM.CYSIZE);
int num = NativeMethods.GetSystemMetrics(SM.CXFRAME) + NativeMethods.GetSystemMetrics(SM.CXEDGE);
int num2 = NativeMethods.GetSystemMetrics(SM.CYFRAME) + NativeMethods.GetSystemMetrics(SM.CYEDGE);
Rect windowCaptionButtonsLocation = new Rect(0.0, 0.0, (double)(systemMetrics * 3), (double)systemMetrics2);
windowCaptionButtonsLocation.Offset((double)(-(double)num) - windowCaptionButtonsLocation.Width, (double)num2);
Rect windowCaptionButtonsLocation = new Rect(0.0, 0.0, (double) (systemMetrics * 3), (double) systemMetrics2);
windowCaptionButtonsLocation.Offset((double) (-(double) num) - windowCaptionButtonsLocation.Width, (double) num2);
this.WindowCaptionButtonsLocation = windowCaptionButtonsLocation;
}
@ -122,7 +122,7 @@ namespace Microsoft.Windows.Shell
Marshal.StructureToPtr(titlebarinfoex, intPtr, false);
NativeMethods.ShowWindow(this._messageHwnd.Handle, SW.SHOW);
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
{
@ -131,7 +131,7 @@ namespace Microsoft.Windows.Shell
}
RECT rect = RECT.Union(titlebarinfoex.rgrect_CloseButton, titlebarinfoex.rgrect_MinimizeButton);
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);
this.WindowCaptionButtonsLocation = windowCaptionButtonsLocation;
}
@ -143,7 +143,7 @@ namespace Microsoft.Windows.Shell
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)
@ -201,7 +201,7 @@ namespace Microsoft.Windows.Shell
}
}
windowCornerRadius = new CornerRadius(0.0);
IL_E6:
IL_E6:
this.WindowCornerRadius = windowCornerRadius;
}
@ -212,8 +212,8 @@ namespace Microsoft.Windows.Shell
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.Dispatcher.ShutdownStarted += delegate(object sender, EventArgs e)
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)
{
Utility.SafeDispose<MessageWindow>(ref this._messageHwnd);
};

View File

@ -19,7 +19,7 @@ namespace Microsoft.Windows.Shell
public static TaskbarItemInfo GetTaskbarItemInfo(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")]
@ -35,9 +35,9 @@ namespace Microsoft.Windows.Shell
{
return;
}
Window window = (Window)d;
TaskbarItemInfo taskbarItemInfo = (TaskbarItemInfo)e.OldValue;
TaskbarItemInfo taskbarItemInfo2 = (TaskbarItemInfo)e.NewValue;
Window window = (Window) d;
TaskbarItemInfo taskbarItemInfo = (TaskbarItemInfo) e.OldValue;
TaskbarItemInfo taskbarItemInfo2 = (TaskbarItemInfo) e.NewValue;
if (taskbarItemInfo == taskbarItemInfo2)
{
return;
@ -63,8 +63,8 @@ namespace Microsoft.Windows.Shell
return value;
}
Verify.IsNotNull<DependencyObject>(d, "d");
Window window = (Window)d;
TaskbarItemInfo taskbarItemInfo = (TaskbarItemInfo)value;
Window window = (Window) d;
TaskbarItemInfo taskbarItemInfo = (TaskbarItemInfo) value;
if (taskbarItemInfo != null && taskbarItemInfo._window != null && taskbarItemInfo._window != window)
{
throw new NotSupportedException();
@ -77,7 +77,7 @@ namespace Microsoft.Windows.Shell
{
get
{
return (TaskbarItemProgressState)base.GetValue(TaskbarItemInfo.ProgressStateProperty);
return (TaskbarItemProgressState) base.GetValue(TaskbarItemInfo.ProgressStateProperty);
}
set
{
@ -115,7 +115,7 @@ namespace Microsoft.Windows.Shell
{
get
{
return (double)base.GetValue(TaskbarItemInfo.ProgressValueProperty);
return (double) base.GetValue(TaskbarItemInfo.ProgressValueProperty);
}
set
{
@ -147,7 +147,7 @@ namespace Microsoft.Windows.Shell
{
get
{
return (ImageSource)base.GetValue(TaskbarItemInfo.OverlayProperty);
return (ImageSource) base.GetValue(TaskbarItemInfo.OverlayProperty);
}
set
{
@ -168,7 +168,7 @@ namespace Microsoft.Windows.Shell
{
get
{
return (string)base.GetValue(TaskbarItemInfo.DescriptionProperty);
return (string) base.GetValue(TaskbarItemInfo.DescriptionProperty);
}
set
{
@ -189,7 +189,7 @@ namespace Microsoft.Windows.Shell
{
get
{
return (Thickness)base.GetValue(TaskbarItemInfo.ThumbnailClipMarginProperty);
return (Thickness) base.GetValue(TaskbarItemInfo.ThumbnailClipMarginProperty);
}
set
{
@ -221,7 +221,7 @@ namespace Microsoft.Windows.Shell
{
get
{
return (ThumbButtonInfoCollection)base.GetValue(TaskbarItemInfo.ThumbButtonInfosProperty);
return (ThumbButtonInfoCollection) base.GetValue(TaskbarItemInfo.ThumbButtonInfosProperty);
}
set
{
@ -263,7 +263,7 @@ namespace Microsoft.Windows.Shell
{
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();
}
@ -303,7 +303,7 @@ namespace Microsoft.Windows.Shell
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._isAttached = true;
@ -390,7 +390,7 @@ namespace Microsoft.Windows.Shell
{
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);
}
@ -437,7 +437,7 @@ namespace Microsoft.Windows.Shell
{
Thickness thumbnailClipMargin = this.ThumbnailClipMargin;
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)
{
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 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);
@ -462,12 +462,12 @@ namespace Microsoft.Windows.Shell
{
array[i] = new THUMBBUTTON
{
iId = (uint)i,
iId = (uint) i,
dwFlags = (THBF.DISABLED | THBF.NOBACKGROUND | THBF.HIDDEN),
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)
{
hresult = HRESULT.S_FALSE;
@ -518,15 +518,15 @@ namespace Microsoft.Windows.Shell
default:
goto IL_A5;
}
IL_146:
array[(int)((UIntPtr)num)] = thumbbutton;
IL_146:
array[(int) ((UIntPtr) num)] = thumbbutton;
num += 1u;
if (num != 7u)
{
continue;
}
break;
IL_A5:
IL_A5:
thumbbutton.szTip = (thumbButtonInfo.Description ?? "");
thumbbutton.hIcon = this._GetHICONFromImageSource(thumbButtonInfo.ImageSource, this._overlaySize);
if (!thumbButtonInfo.IsBackgroundVisible)
@ -554,20 +554,20 @@ namespace Microsoft.Windows.Shell
}
goto IL_1AE;
}
IL_179:
array[(int)((UIntPtr)num)] = new THUMBBUTTON
IL_179:
array[(int) ((UIntPtr) num)] = new THUMBBUTTON
{
iId = num,
dwFlags = (THBF.DISABLED | THBF.NOBACKGROUND | THBF.HIDDEN),
dwMask = (THB.ICON | THB.TOOLTIP | THB.FLAGS)
};
num += 1u;
IL_1AE:
IL_1AE:
if (num < 7u)
{
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
{
@ -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 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();
}, (DependencyObject d, object e) => TaskbarItemInfo._CoerceProgressState((TaskbarItemProgressState)e)));
((TaskbarItemInfo) d)._OnProgressStateChanged();
}, (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();
}, (DependencyObject d, object e) => TaskbarItemInfo._CoerceProgressValue((double)e)));
((TaskbarItemInfo) d)._OnProgressValueChanged();
}, (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();
}, (DependencyObject d, object e) => TaskbarItemInfo._CoerceThumbnailClipMargin((Thickness)e)));
((TaskbarItemInfo) d)._OnThumbnailClipMarginChanged();
}, (DependencyObject d, object e) => TaskbarItemInfo._CoerceThumbnailClipMargin((Thickness) e)));
[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();
}));
}
}

View File

@ -18,7 +18,7 @@ namespace Microsoft.Windows.Shell
{
get
{
return (Visibility)base.GetValue(ThumbButtonInfo.VisibilityProperty);
return (Visibility) base.GetValue(ThumbButtonInfo.VisibilityProperty);
}
set
{
@ -30,7 +30,7 @@ namespace Microsoft.Windows.Shell
{
get
{
return (bool)base.GetValue(ThumbButtonInfo.DismissWhenClickedProperty);
return (bool) base.GetValue(ThumbButtonInfo.DismissWhenClickedProperty);
}
set
{
@ -42,7 +42,7 @@ namespace Microsoft.Windows.Shell
{
get
{
return (ImageSource)base.GetValue(ThumbButtonInfo.ImageSourceProperty);
return (ImageSource) base.GetValue(ThumbButtonInfo.ImageSourceProperty);
}
set
{
@ -54,7 +54,7 @@ namespace Microsoft.Windows.Shell
{
get
{
return (bool)base.GetValue(ThumbButtonInfo.IsBackgroundVisibleProperty);
return (bool) base.GetValue(ThumbButtonInfo.IsBackgroundVisibleProperty);
}
set
{
@ -66,7 +66,7 @@ namespace Microsoft.Windows.Shell
{
get
{
return (string)base.GetValue(ThumbButtonInfo.DescriptionProperty);
return (string) base.GetValue(ThumbButtonInfo.DescriptionProperty);
}
set
{
@ -76,7 +76,7 @@ namespace Microsoft.Windows.Shell
private static object _CoerceDescription(DependencyObject d, object value)
{
string text = (string)value;
string text = (string) value;
if (text != null && text.Length >= 260)
{
text = text.Substring(0, 259);
@ -86,7 +86,7 @@ namespace Microsoft.Windows.Shell
private object _CoerceIsEnabledValue(object value)
{
bool flag = (bool)value;
bool flag = (bool) value;
return flag && this._CanExecute;
}
@ -94,7 +94,7 @@ namespace Microsoft.Windows.Shell
{
get
{
return (bool)base.GetValue(ThumbButtonInfo.IsEnabledProperty);
return (bool) base.GetValue(ThumbButtonInfo.IsEnabledProperty);
}
set
{
@ -106,7 +106,7 @@ namespace Microsoft.Windows.Shell
{
get
{
return (bool)base.GetValue(ThumbButtonInfo.IsInteractiveProperty);
return (bool) base.GetValue(ThumbButtonInfo.IsInteractiveProperty);
}
set
{
@ -116,8 +116,8 @@ namespace Microsoft.Windows.Shell
private void _OnCommandChanged(DependencyPropertyChangedEventArgs e)
{
ICommand command = (ICommand)e.OldValue;
ICommand command2 = (ICommand)e.NewValue;
ICommand command = (ICommand) e.OldValue;
ICommand command2 = (ICommand) e.NewValue;
if (command == command2)
{
return;
@ -136,7 +136,7 @@ namespace Microsoft.Windows.Shell
{
get
{
return (bool)base.GetValue(ThumbButtonInfo._CanExecuteProperty);
return (bool) base.GetValue(ThumbButtonInfo._CanExecuteProperty);
}
set
{
@ -188,7 +188,7 @@ namespace Microsoft.Windows.Shell
private void _HookCommand(ICommand command)
{
this._commandEvent = delegate(object sender, EventArgs e)
this._commandEvent = delegate (object sender, EventArgs e)
{
this._UpdateCanExecute();
};
@ -218,7 +218,7 @@ namespace Microsoft.Windows.Shell
{
get
{
return (ICommand)base.GetValue(ThumbButtonInfo.CommandProperty);
return (ICommand) base.GetValue(ThumbButtonInfo.CommandProperty);
}
set
{
@ -242,7 +242,7 @@ namespace Microsoft.Windows.Shell
{
get
{
return (IInputElement)base.GetValue(ThumbButtonInfo.CommandTargetProperty);
return (IInputElement) base.GetValue(ThumbButtonInfo.CommandTargetProperty);
}
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 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 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);
}));

View File

@ -24,8 +24,8 @@ namespace Microsoft.Windows.Shell
{
return;
}
Window window = (Window)d;
WindowChrome windowChrome = (WindowChrome)e.NewValue;
Window window = (Window) d;
WindowChrome windowChrome = (WindowChrome) e.NewValue;
WindowChromeWorker windowChromeWorker = WindowChromeWorker.GetWindowChromeWorker(window);
if (windowChromeWorker == null)
{
@ -40,7 +40,7 @@ namespace Microsoft.Windows.Shell
public static WindowChrome GetWindowChrome(Window window)
{
Verify.IsNotNull<Window>(window, "window");
return (WindowChrome)window.GetValue(WindowChrome.WindowChromeProperty);
return (WindowChrome) window.GetValue(WindowChrome.WindowChromeProperty);
}
[SuppressMessage("Microsoft.Design", "CA1011:ConsiderPassingBaseTypesAsParameters")]
@ -61,7 +61,7 @@ namespace Microsoft.Windows.Shell
{
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")]
@ -81,7 +81,7 @@ namespace Microsoft.Windows.Shell
{
get
{
return (double)base.GetValue(WindowChrome.CaptionHeightProperty);
return (double) base.GetValue(WindowChrome.CaptionHeightProperty);
}
set
{
@ -93,7 +93,7 @@ namespace Microsoft.Windows.Shell
{
get
{
return (Thickness)base.GetValue(WindowChrome.ResizeBorderThicknessProperty);
return (Thickness) base.GetValue(WindowChrome.ResizeBorderThicknessProperty);
}
set
{
@ -114,7 +114,7 @@ namespace Microsoft.Windows.Shell
{
get
{
return (Thickness)base.GetValue(WindowChrome.GlassFrameThicknessProperty);
return (Thickness) base.GetValue(WindowChrome.GlassFrameThicknessProperty);
}
set
{
@ -126,7 +126,7 @@ namespace Microsoft.Windows.Shell
{
get
{
return (CornerRadius)base.GetValue(WindowChrome.CornerRadiusProperty);
return (CornerRadius) base.GetValue(WindowChrome.CornerRadiusProperty);
}
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 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();
}), (object value) => (double)value >= 0.0);
((WindowChrome) d)._OnPropertyChangedThatRequiresRepaint();
}), (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();
}, (DependencyObject d, object o) => WindowChrome._CoerceGlassFrameThickness((Thickness)o)));
((WindowChrome) d)._OnPropertyChangedThatRequiresRepaint();
}, (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();
}), (object value) => Utility.IsCornerRadiusValid((CornerRadius)value));
((WindowChrome) d)._OnPropertyChangedThatRequiresRepaint();
}), (object value) => Utility.IsCornerRadiusValid((CornerRadius) value));
private static readonly List<WindowChrome._SystemParameterBoundProperty> _BoundProperties = new List<WindowChrome._SystemParameterBoundProperty>
{

View File

@ -65,8 +65,8 @@ namespace Microsoft.Windows.Shell
private static void _OnChromeWorkerChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
{
Window window = (Window)d;
WindowChromeWorker windowChromeWorker = (WindowChromeWorker)e.NewValue;
Window window = (Window) d;
WindowChromeWorker windowChromeWorker = (WindowChromeWorker) e.NewValue;
windowChromeWorker._SetWindow(window);
}
@ -92,7 +92,7 @@ namespace Microsoft.Windows.Shell
}
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._hwndSource = HwndSource.FromHwnd(this._hwnd);
@ -122,7 +122,7 @@ namespace Microsoft.Windows.Shell
public static WindowChromeWorker GetWindowChromeWorker(Window window)
{
Verify.IsNotNull<Window>(window, "window");
return (WindowChromeWorker)window.GetValue(WindowChromeWorker.WindowChromeWorkerProperty);
return (WindowChromeWorker) window.GetValue(WindowChromeWorker.WindowChromeWorkerProperty);
}
[SuppressMessage("Microsoft.Design", "CA1011:ConsiderPassingBaseTypesAsParameters")]
@ -177,11 +177,11 @@ namespace Microsoft.Windows.Shell
this._window.Dispatcher.BeginInvoke(DispatcherPriority.Loaded, new WindowChromeWorker._Action(this._FixupFrameworkIssues));
return;
}
FrameworkElement frameworkElement = (FrameworkElement)VisualTreeHelper.GetChild(this._window, 0);
FrameworkElement frameworkElement = (FrameworkElement) VisualTreeHelper.GetChild(this._window, 0);
RECT windowRect = NativeMethods.GetWindowRect(this._hwnd);
RECT rect = this._GetAdjustedWindowRect(windowRect);
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 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));
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));
if (this._window.FlowDirection == FlowDirection.RightToLeft)
@ -238,7 +238,7 @@ namespace Microsoft.Windows.Shell
Bottom = 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.Left = point.X;
}
@ -246,8 +246,8 @@ namespace Microsoft.Windows.Shell
private RECT _GetAdjustedWindowRect(RECT rcWindow)
{
WS dwStyle = (WS)((int)NativeMethods.GetWindowLongPtr(this._hwnd, GWL.STYLE));
WS_EX dwExStyle = (WS_EX)((int)NativeMethods.GetWindowLongPtr(this._hwnd, GWL.EXSTYLE));
WS dwStyle = (WS) ((int) NativeMethods.GetWindowLongPtr(this._hwnd, GWL.STYLE));
WS_EX dwExStyle = (WS_EX) ((int) NativeMethods.GetWindowLongPtr(this._hwnd, GWL.EXSTYLE));
return NativeMethods.AdjustWindowRectEx(rcWindow, dwStyle, false, dwExStyle);
}
@ -265,7 +265,7 @@ namespace Microsoft.Windows.Shell
Right = 100
});
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;
}
}
@ -274,9 +274,9 @@ namespace Microsoft.Windows.Shell
{
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;
@ -317,7 +317,7 @@ namespace Microsoft.Windows.Shell
}
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();
HT ht = this._HitTestNca(DpiHelper.DeviceRectToLogical(deviceRectangle), DpiHelper.DevicePixelsToLogical(point));
if (ht != HT.CLIENT)
@ -332,7 +332,7 @@ namespace Microsoft.Windows.Shell
}
}
handled = true;
intPtr = new IntPtr((int)ht);
intPtr = new IntPtr((int) ht);
}
return intPtr;
}
@ -341,7 +341,7 @@ namespace Microsoft.Windows.Shell
{
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;
return IntPtr.Zero;
@ -364,7 +364,7 @@ namespace Microsoft.Windows.Shell
this._UpdateSystemMenu(null);
if (!this._isGlassEnabled)
{
WINDOWPOS value = (WINDOWPOS)Marshal.PtrToStructure(lParam, typeof(WINDOWPOS));
WINDOWPOS value = (WINDOWPOS) Marshal.PtrToStructure(lParam, typeof(WINDOWPOS));
this._SetRoundingRegion(new WINDOWPOS?(value));
}
handled = false;
@ -420,13 +420,13 @@ namespace Microsoft.Windows.Shell
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;
if (ws == ws2)
{
return false;
}
NativeMethods.SetWindowLongPtr(this._hwnd, GWL.STYLE, new IntPtr((int)ws2));
NativeMethods.SetWindowLongPtr(this._hwnd, GWL.STYLE, new IntPtr((int) ws2));
return true;
}
@ -447,7 +447,7 @@ namespace Microsoft.Windows.Shell
private Rect _GetWindowRect()
{
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)
@ -460,10 +460,10 @@ namespace Microsoft.Windows.Shell
IntPtr systemMenu = NativeMethods.GetSystemMenu(this._hwnd, false);
if (IntPtr.Zero != systemMenu)
{
WS value = (WS)NativeMethods.GetWindowLongPtr(this._hwnd, GWL.STYLE).ToInt32();
bool flag2 = Utility.IsFlagSet((int)value, 131072);
bool flag3 = Utility.IsFlagSet((int)value, 65536);
bool flag4 = Utility.IsFlagSet((int)value, 262144);
WS value = (WS) NativeMethods.GetWindowLongPtr(this._hwnd, GWL.STYLE).ToInt32();
bool flag2 = Utility.IsFlagSet((int) value, 131072);
bool flag3 = Utility.IsFlagSet((int) value, 65536);
bool flag4 = Utility.IsFlagSet((int) value, 262144);
switch (windowState)
{
case WindowState.Minimized:
@ -540,8 +540,8 @@ namespace Microsoft.Windows.Shell
else
{
Rect rect = this._GetWindowRect();
num = (int)rect.Left;
num2 = (int)rect.Top;
num = (int) rect.Left;
num2 = (int) rect.Top;
}
IntPtr hMonitor = NativeMethods.MonitorFromWindow(this._hwnd, 2u);
MONITORINFO monitorInfo = NativeMethods.GetMonitorInfo(hMonitor);
@ -563,7 +563,7 @@ namespace Microsoft.Windows.Shell
Size size;
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
{
@ -616,9 +616,9 @@ namespace Microsoft.Windows.Shell
{
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")]
@ -665,10 +665,10 @@ namespace Microsoft.Windows.Shell
Point point2 = DpiHelper.LogicalPixelsToDevice(new Point(this._chromeInfo.GlassFrameThickness.Right, this._chromeInfo.GlassFrameThickness.Bottom));
MARGINS margins = new MARGINS
{
cxLeftWidth = (int)Math.Ceiling(point.X),
cxRightWidth = (int)Math.Ceiling(point2.X),
cyTopHeight = (int)Math.Ceiling(point.Y),
cyBottomHeight = (int)Math.Ceiling(point2.Y)
cxLeftWidth = (int) Math.Ceiling(point.X),
cxRightWidth = (int) Math.Ceiling(point2.X),
cyTopHeight = (int) Math.Ceiling(point.Y),
cyBottomHeight = (int) Math.Ceiling(point2.Y)
};
NativeMethods.DwmExtendFrameIntoClientArea(this._hwnd, ref margins);
}
@ -683,11 +683,11 @@ namespace Microsoft.Windows.Shell
flag = (mousePosition.Y < windowPosition.Top + this._chromeInfo.ResizeBorderThickness.Top);
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;
}
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;
}
@ -733,7 +733,7 @@ namespace Microsoft.Windows.Shell
{
if (Utility.IsPresentationFrameworkVersionLessThan4)
{
FrameworkElement frameworkElement = (FrameworkElement)VisualTreeHelper.GetChild(this._window, 0);
FrameworkElement frameworkElement = (FrameworkElement) VisualTreeHelper.GetChild(this._window, 0);
frameworkElement.Margin = default(Thickness);
this._window.StateChanged -= this._FixupRestoreBounds;
this._isFixedUp = false;