Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
57 changes: 28 additions & 29 deletions src/Common/src/CompModSwitches.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Scope="member", Target="System.ComponentModel.CompModSwitches.get_LayoutPerformance():System.Diagnostics.TraceSwitch")]

namespace System.ComponentModel {
using System.Diagnostics;
using System.Diagnostics;

internal static class CompModSwitches {
#if WINDOWS_FORMS_SWITCHES

private static TraceSwitch activeX;
private static TraceSwitch flowLayout;
private static TraceSwitch dataCursor;
Expand All @@ -18,17 +18,17 @@ internal static class CompModSwitches {
private static TraceSwitch dataGridKeys;
private static TraceSwitch dataGridLayout;
private static TraceSwitch dataGridPainting;
private static TraceSwitch dataGridParents;
private static TraceSwitch dataGridParents;
private static TraceSwitch dataGridScrolling;
private static TraceSwitch dataGridSelection;
private static TraceSwitch dataObject;
private static TraceSwitch dataGridSelection;
private static TraceSwitch dataObject;
private static TraceSwitch dataView;
private static TraceSwitch debugGridView;
private static TraceSwitch dgCaptionPaint;
private static TraceSwitch dgEditColumnEditing;
private static TraceSwitch dgCaptionPaint;
private static TraceSwitch dgEditColumnEditing;
private static TraceSwitch dgRelationShpRowLayout;
private static TraceSwitch dgRelationShpRowPaint;
private static TraceSwitch dgRowPaint;
private static TraceSwitch dgRowPaint;
private static TraceSwitch dragDrop;
private static TraceSwitch imeMode;
private static TraceSwitch msaa;
Expand All @@ -39,7 +39,7 @@ internal static class CompModSwitches {
private static TraceSwitch setBounds;

private static BooleanSwitch lifetimeTracing;

private static TraceSwitch s_handleLeak;
private static BooleanSwitch s_traceCollect;
private static BooleanSwitch s_commonDesignerServices;
Expand All @@ -51,7 +51,7 @@ public static TraceSwitch ActiveX {
}
return activeX;
}
}
}

public static TraceSwitch DataCursor {
get {
Expand Down Expand Up @@ -88,7 +88,7 @@ public static TraceSwitch DataGridKeys {
return dataGridKeys;
}
}

public static TraceSwitch DataGridLayout {
get {
if (dataGridLayout == null) {
Expand All @@ -106,7 +106,7 @@ public static TraceSwitch DataGridPainting {
return dataGridPainting;
}
}

public static TraceSwitch DataGridParents {
get {
if (dataGridParents == null) {
Expand All @@ -133,7 +133,7 @@ public static TraceSwitch DataGridSelection {
return dataGridSelection;
}
}

public static TraceSwitch DataObject {
get {
if (dataObject == null) {
Expand All @@ -150,7 +150,7 @@ public static TraceSwitch DataView {
}
return dataView;
}
}
}

public static TraceSwitch DebugGridView {
get {
Expand All @@ -159,8 +159,8 @@ public static TraceSwitch DebugGridView {
}
return debugGridView;
}
}
}

public static TraceSwitch DGCaptionPaint {
get {
if (dgCaptionPaint == null) {
Expand All @@ -169,7 +169,7 @@ public static TraceSwitch DGCaptionPaint {
return dgCaptionPaint;
}
}

public static TraceSwitch DGEditColumnEditing {
get {
if (dgEditColumnEditing == null) {
Expand All @@ -178,7 +178,7 @@ public static TraceSwitch DGEditColumnEditing {
return dgEditColumnEditing;
}
}

public static TraceSwitch DGRelationShpRowLayout {
get {
if (dgRelationShpRowLayout == null) {
Expand All @@ -187,16 +187,16 @@ public static TraceSwitch DGRelationShpRowLayout {
return dgRelationShpRowLayout;
}
}

public static TraceSwitch DGRelationShpRowPaint {
get {
if (dgRelationShpRowPaint == null) {
dgRelationShpRowPaint = new TraceSwitch("DGRelationShpRowPaint", "Relationship row painting");
}
return dgRelationShpRowPaint;
}
}
}

public static TraceSwitch DGRowPaint {
get {
if (dgRowPaint == null) {
Expand All @@ -222,8 +222,8 @@ public static TraceSwitch FlowLayout {
}
return flowLayout;
}
}
}

public static TraceSwitch ImeMode {
get {
if (imeMode == null) {
Expand All @@ -241,7 +241,7 @@ public static TraceSwitch LayoutPerformance {
return layoutPerformance;
}
}

public static TraceSwitch LayoutSuspendResume {
get {
if (layoutSuspendResume == null) {
Expand All @@ -259,7 +259,7 @@ public static BooleanSwitch LifetimeTracing {
return lifetimeTracing;
}
}

public static TraceSwitch MSAA {
get {
if (msaa == null) {
Expand All @@ -268,7 +268,7 @@ public static TraceSwitch MSAA {
return msaa;
}
}

public static TraceSwitch MSOComponentManager {
get {
if (msoComponentManager == null) {
Expand All @@ -277,7 +277,7 @@ public static TraceSwitch MSOComponentManager {
return msoComponentManager;
}
}

public static TraceSwitch RichLayout {
get {
if (richLayout == null) {
Expand All @@ -295,7 +295,6 @@ public static TraceSwitch SetBounds {
return setBounds;
}
}
#endif

public static TraceSwitch HandleLeak {
get {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<!--the obsolete usage in public surface can't be removed-->
<NoWarn>$(NoWarn);618</NoWarn>
<DefineConstants>$(DefineConstants);DRAWING_DESIGN_NAMESPACE;WINDOWS_FORMS_SWITCHES;</DefineConstants>
<DefineConstants>$(DefineConstants);DRAWING_DESIGN_NAMESPACE</DefineConstants>
</PropertyGroup>

<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion src/System.Windows.Forms/src/System.Windows.Forms.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<CLSCompliant>true</CLSCompliant>
<!--the obsolete usage in public surface can't be removed-->
<NoWarn>$(NoWarn);618</NoWarn>
<DefineConstants>$(DefineConstants);WIN95_SUPPORT;WINDOWS_FORMS_SWITCHES;DRAWING_DESIGN_NAMESPACE;OPTIMIZED_MEASUREMENTDC;</DefineConstants>
<DefineConstants>$(DefineConstants);DRAWING_DESIGN_NAMESPACE;OPTIMIZED_MEASUREMENTDC;</DefineConstants>
<Win32Manifest>Resources\System\Windows\Forms\XPThemes.manifest</Win32Manifest>
<Deterministic>true</Deterministic>
<ProduceReferenceAssembly>true</ProduceReferenceAssembly>
Expand Down
10 changes: 1 addition & 9 deletions src/System.Windows.Forms/src/System/Windows/Forms/Control.cs
Original file line number Diff line number Diff line change
Expand Up @@ -282,17 +282,15 @@ static Control() {
internal static readonly object EventPaddingChanged = new object();
private static readonly object EventPreviewKeyDown = new object();

#if WIN95_SUPPORT
private static int mouseWheelMessage = Interop.WindowMessages.WM_MOUSEWHEEL;
private static bool mouseWheelRoutingNeeded;
private static bool mouseWheelInit;
#endif

private static int threadCallbackMessage;

// Initially check for illegal multithreading based on whether the
// debugger is attached.

private static bool checkForIllegalCrossThreadCalls = Debugger.IsAttached;
private static ContextCallback invokeMarshaledCallbackHelperDelegate;

Expand Down Expand Up @@ -494,9 +492,7 @@ internal Control(bool autoInstallSyncContext) : base() {
ControlStyles.UseTextForAccessibility |
ControlStyles.Selectable,true);

#if WIN95_SUPPORT
InitMouseWheelSupport();
#endif

// We baked the "default default" margin and min size into CommonProperties
// so that in the common case the PropertyStore would be empty. If, however,
Expand Down Expand Up @@ -6912,7 +6908,6 @@ internal virtual IntPtr InitializeDCForWmCtlColor (IntPtr dc, int msg) {
}
}

#if WIN95_SUPPORT
/// <devdoc>
/// Initializes mouse wheel support. This may involve registering some windows
/// messages on older operating systems.
Expand Down Expand Up @@ -6949,7 +6944,6 @@ private void InitMouseWheelSupport() {
mouseWheelInit = true;
}
}
#endif

/// <include file='doc\Control.uex' path='docs/doc[@for="Control.Invalidate"]/*' />
/// <devdoc>
Expand Down Expand Up @@ -13776,7 +13770,6 @@ protected virtual void WndProc(ref Message m) {
return;
}

#if WIN95_SUPPORT
// If we have to route the mousewheel messages, do it (this logic was taken
// from the MFC sources...)
//
Expand Down Expand Up @@ -13805,7 +13798,6 @@ protected virtual void WndProc(ref Message m) {
}
}
}
#endif

if (m.Msg == NativeMethods.WM_MOUSEENTER) {
WmMouseEnter(ref m);
Expand Down