Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
faf38cc
formatting System.Windows.Forms.Tests
May 23, 2019
f79f41e
formatting System.Windows.Forms.IntegrationTests
May 23, 2019
fd95ff5
formatting System.Windows.Forms.Design.Tests
May 23, 2019
dfda02f
formatting System.Windows.Forms.Design.Editors.Tests
May 23, 2019
37768c0
formatting System.Windows.Forms
May 23, 2019
4dc3a0c
formatting System.Windows.Forms.Design
May 23, 2019
19d35c9
formatting System.Windows.Forms.Design.Editors
May 23, 2019
92becc1
formatting Internal Utilities for Tests
May 23, 2019
4947fb7
formatting straggelers
May 23, 2019
5906c69
remove all instances of IDE0008 warning - remove unambiguous this.
May 24, 2019
a7851a4
remove all instances of IDE0012 warning - prefer var to explicit
May 24, 2019
8d87944
remove all instances of IDE0016 warning - null check can be simplified
May 24, 2019
a269d83
remove all instances of IDE0017 warning - object init can be simplified
May 24, 2019
885c533
remove all instances of IDE0018 warning - Variable declaration can be…
May 24, 2019
06832ca
remove all instances of IDE0011 warning - Add single line braces
May 24, 2019
462c242
remove all instances of IDE0019 warning - use pattern matching (as if…
May 24, 2019
4e6110b
remove all instances of IDE0020 warning - use pattern matching (as if…
May 24, 2019
b4dd049
remove all instances of IDE0028 warning - collection init can be simp…
May 24, 2019
70f4437
remove all instances of IDE0029 warning - null check can be simplifie…
May 24, 2019
69d8b0e
remove all instances of IDE0031 warning - null check can be simplifie…
May 24, 2019
6a380e1
remove all instances of IDE0034 warning - 'default' expression can be…
May 24, 2019
121ad0f
remove all instances of IDE0041 warning - null check can be simplifie…
May 24, 2019
aacca6a
remove all instances of IDE0044 warning - make field readonly
May 24, 2019
97acaa3
remove all instances of IDE0049 warning - simplify type name (ex: Str…
May 24, 2019
5e664d0
remove all instances of IDE0052 warning - use compound assignment (-=)
May 24, 2019
b0ed52f
remove all instances of IDE1005 warning - Delegate invocation can be …
May 24, 2019
30e37bd
fix compile errors caused by formatting changes
May 24, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
304 changes: 186 additions & 118 deletions src/Common/src/ClientUtils.cs

Large diffs are not rendered by default.

30 changes: 15 additions & 15 deletions src/Common/src/CommonUnsafeNativeMethods.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,22 +18,22 @@ internal class CommonUnsafeNativeMethods
internal const int LOAD_LIBRARY_SEARCH_SYSTEM32 = 0x00000800;

[DllImport(ExternDll.Kernel32, SetLastError = true, ExactSpelling = true, CharSet = CharSet.Ansi)]

public static extern IntPtr GetProcAddress(HandleRef hModule, string lpProcName);
[DllImport(ExternDll.Kernel32, SetLastError = true, CharSet = CharSet.Auto)]

public static extern IntPtr GetModuleHandle(string modName);

[DllImport(ExternDll.Kernel32, CharSet = CharSet.Auto, SetLastError = true, BestFitMapping = false)]

private static extern IntPtr LoadLibraryEx(string lpModuleName, IntPtr hFile, uint dwFlags);

[DllImport(ExternDll.Kernel32, CharSet = CharSet.Auto, SetLastError = true)]

private static extern IntPtr LoadLibrary(string libname);

[DllImport(ExternDll.Kernel32, CharSet = CharSet.Auto, SetLastError = true)]

public static extern bool FreeLibrary(HandleRef hModule);

/// <summary>
Expand Down Expand Up @@ -71,11 +71,11 @@ public static IntPtr LoadLibraryFromSystemPathIfAvailable(string libraryName)
// This section could go to Nativemethods.cs or Safenativemethods.cs but we have separate copies of them in each library (System.winforms, System.Design and System.Drawing).
// These APIs are available starting Windows 10, version 1607 only.
[DllImport(ExternDll.User32, SetLastError = true, ExactSpelling = true, CharSet = CharSet.Auto)]

internal static extern DpiAwarenessContext GetThreadDpiAwarenessContext();

[DllImport(ExternDll.User32, SetLastError = true, ExactSpelling = true, CharSet = CharSet.Auto)]

internal static extern DpiAwarenessContext SetThreadDpiAwarenessContext(DpiAwarenessContext dpiContext);

[DllImport(ExternDll.User32, SetLastError = true, ExactSpelling = true, CharSet = CharSet.Auto)]
Expand All @@ -89,7 +89,7 @@ public static IntPtr LoadLibraryFromSystemPathIfAvailable(string libraryName)
/// <returns>true/false</returns>
public static bool TryFindDpiAwarenessContextsEqual(DpiAwarenessContext dpiContextA, DpiAwarenessContext dpiContextB)
{
if(dpiContextA == DpiAwarenessContext.DPI_AWARENESS_CONTEXT_UNSPECIFIED && dpiContextB == DpiAwarenessContext.DPI_AWARENESS_CONTEXT_UNSPECIFIED)
if (dpiContextA == DpiAwarenessContext.DPI_AWARENESS_CONTEXT_UNSPECIFIED && dpiContextB == DpiAwarenessContext.DPI_AWARENESS_CONTEXT_UNSPECIFIED)
{
return true;
}
Expand Down Expand Up @@ -138,13 +138,13 @@ public static DpiAwarenessContext TrySetThreadDpiAwarenessContext(DpiAwarenessCo
return DpiAwarenessContext.DPI_AWARENESS_CONTEXT_UNSPECIFIED;
}
}
/*
// Dpi awareness context values. Matching windows values.
public static readonly DPI_AWARENESS_CONTEXT DPI_AWARENESS_CONTEXT_UNAWARE = (-1);
public static readonly DPI_AWARENESS_CONTEXT DPI_AWARENESS_CONTEXT_SYSTEM_AWARE = (-2);
public static readonly DPI_AWARENESS_CONTEXT DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE = (-3);
public static readonly DPI_AWARENESS_CONTEXT DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE_V2 = (-4);
public static readonly DPI_AWARENESS_CONTEXT DPI_AWARENESS_CONTEXT_UNSPECIFIED = (0);*/
/*
// Dpi awareness context values. Matching windows values.
public static readonly DPI_AWARENESS_CONTEXT DPI_AWARENESS_CONTEXT_UNAWARE = (-1);
public static readonly DPI_AWARENESS_CONTEXT DPI_AWARENESS_CONTEXT_SYSTEM_AWARE = (-2);
public static readonly DPI_AWARENESS_CONTEXT DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE = (-3);
public static readonly DPI_AWARENESS_CONTEXT DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE_V2 = (-4);
public static readonly DPI_AWARENESS_CONTEXT DPI_AWARENESS_CONTEXT_UNSPECIFIED = (0);*/
#endregion
}
}
Loading