8000 [StyleCleanUp] Order modifiers on members/types (IDE0036) (#10601) · dotnet/wpf@2ded801 · GitHub
[go: up one dir, main page]

Skip to content

Commit 2ded801

Browse files
authored
[StyleCleanUp] Order modifiers on members/types (IDE0036) (#10601)
* Fix PresentationFramework * Fix PresentationCore * Fix UIAutomation * Fix UIAutomationClientSideProviders * Fx WindowsBase * Fix ReachFramework * Fix Ribbon * Fix the rest * Fix post-merge
1 parent 9cfcf9e commit 2ded801

File tree

371 files changed

+2032
-2069
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

371 files changed

+2032
-2069
lines changed

eng/WpfArcadeSdk/tools/CodeGen/AvTrace/AvTraceMessages.tt

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,9 @@ namespace MS.Internal
2929
string name = source.Attribute("Name").Value;
3030
string traceClassName = source.Attribute("TraceNameOverride")?.Value ?? $"Trace{name}";
3131
#>
32-
static internal partial class <#= traceClassName #>
32+
internal static partial class <#= traceClassName #>
3333
{
34-
static private AvTrace _avTrace = new AvTrace(
34+
private static AvTrace _avTrace = new AvTrace(
3535
delegate() { return PresentationTraceSources.<#=name#>Source; },
3636
delegate() { PresentationTraceSources._<#=name#>Source = null; }
3737
);
@@ -45,7 +45,7 @@ namespace MS.Internal
4545

4646
static AvTraceDetails _<#=traceName#>;
4747
<# if (IsFormattedTraceMessage(traceDetails)) { #>
48-
static public AvTraceDetails <#= traceName #>(params object[] args)
48+
public static AvTraceDetails <#= traceName #>(params object[] args)
4949
{
5050
if ( _<#=traceName#> == null )
5151
{
@@ -54,7 +54,7 @@ namespace MS.Internal
5454
return new AvTraceFormat(_<#= traceName #>, args);
5555
}
5656
<# } else { #>
57-
static public AvTraceDetails <#= traceName #>
57+
public static AvTraceDetails <#= traceName #>
5858
{
5959
get
6060
{
@@ -70,66 +70,66 @@ namespace MS.Internal
7070
<# } #>
7171

7272
/// <summary> Send a single trace output </summary>
73-
static public void Trace( TraceEventType type, AvTraceDetails traceDetails, params object[] parameters )
73+
public static void Trace( TraceEventType type, AvTraceDetails traceDetails, params object[] parameters )
7474
{
7575
_avTrace.Trace( type, traceDetails.Id, traceDetails.Message, traceDetails.Labels, parameters );
7676
}
7777

7878
/// <summary> These help delay allocation of object array </summary>
79-
static public void Trace( TraceEventType type, AvTraceDetails traceDetails )
79+
public static void Trace( TraceEventType type, AvTraceDetails traceDetails )
8080
{
8181
_avTrace.Trace( type, traceDetails.Id, traceDetails.Message, traceDetails.Labels, Array.Empty<object>() );
8282
}
83-
static public void Trace( TraceEventType type, AvTraceDetails traceDetails, object p1 )
83+
public static void Trace( TraceEventType type, AvTraceDetails traceDetails, object p1 )
8484
{
8585
_avTrace.Trace( type, traceDetails.Id, traceDetails.Message, traceDetails.Labels, new object[] { p1 } );
8686
}
87-
static public void Trace( TraceEventType type, AvTraceDetails traceDetails, object p1, object p2 )
87+
public static void Trace( TraceEventType type, AvTraceDetails traceDetails, object p1, object p2 )
8888
{
8989
_avTrace.Trace( type, traceDetails.Id, traceDetails.Message, traceDetails.Labels, new object[] { p1, p2 } );
9090
}
91-
static public void Trace( TraceEventType type, AvTraceDetails traceDetails, object p1, object p2, object p3 )
91+
public static void Trace( TraceEventType type, AvTraceDetails traceDetails, object p1, object p2, object p3 )
9292
{
9393
_avTrace.Trace( type, traceDetails.Id, traceDetails.Message, traceDetails.Labels, new object[] { p1, p2, p3 } );
9494
}
9595

9696
/// <summary> Send a singleton "activity" trace (really, this sends the same trace as both a Start and a Stop) </summary>
97-
static public void TraceActivityItem( AvTraceDetails traceDetails, params Object[] parameters )
97+
public static void TraceActivityItem( AvTraceDetails traceDetails, params Object[] parameters )
9898
{
9999
_avTrace.TraceStartStop( traceDetails.Id, traceDetails.Message, traceDetails.Labels, parameters );
100100
}
101101

102102
/// <summary> These help delay allocation of object array </summary>
103-
static public void TraceActivityItem( AvTraceDetails traceDetails )
103+
public static void TraceActivityItem( AvTraceDetails traceDetails )
104104
{
105105
_avTrace.TraceStartStop( traceDetails.Id, traceDetails.Message, traceDetails.Labels, Array.Empty<object>() );
106106
}
107-
static public void TraceActivityItem( AvTraceDetails traceDetails, object p1 )
107+
public static void TraceActivityItem( AvTraceDetails traceDetails, object p1 )
108108
{
109109
_avTrace.TraceStartStop( traceDetails.Id, traceDetails.Message, traceDetails.Labels, new object[] { p1 } );
110110
}
111-
static public void TraceActivityItem( AvTraceDetails traceDetails, object p1, object p2 )
111+
public static void TraceActivityItem( AvTraceDetails traceDetails, object p1, object p2 )
112112
{
113113
_avTrace.TraceStartStop( traceDetails.Id, traceDetails.Message, traceDetails.Labels, new object[] { p1, p2 } );
114114
}
115-
static public void TraceActivityItem( AvTraceDetails traceDetails, object p1, object p2, object p3 )
115+
public static void TraceActivityItem( AvTraceDetails traceDetails, object p1, object p2, object p3 )
116116
{
117117
_avTrace.TraceStartStop( traceDetails.Id, traceDetails.Message, traceDetails.Labels, new object[] { p1, p2, p3 } );
118118
}
119119

120-
static public bool IsEnabled
120+
public static bool IsEnabled
121121
{
122122
get { return _avTrace != null && _avTrace.IsEnabled; }
123123
}
124124

125125
/// <summary> Is there a Tracesource? (See comment on AvTrace.IsEnabledOverride.) </summary>
126-
static public bool IsEnabledOverride
126+
public static bool IsEnabledOverride
127127
{
128128
get { return _avTrace.IsEnabledOverride; }
129129
}
130130

131131
/// <summary> Re-read the configuration for this trace source </summary>
132-
static public void Refresh()
132+
public static void Refresh()
133133
{
134134
_avTrace.Refresh();
135135
}

src/Microsoft.DotNet.Wpf/cycle-breakers/PresentationFramework/PresentationFramework.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7708,9 +7708,9 @@ public static void SetVirtualizationMode(System.Windows.DependencyObject element
77087708
public partial class VirtualizingStackPanel : System.Windows.Controls.VirtualizingPanel, System.Windows.Controls.Primitives.IScrollInfo
77097709
{
77107710
public static readonly System.Windows.RoutedEvent CleanUpVirtualizedItemEvent;
7711-
public static readonly new System.Windows.DependencyProperty IsVirtualizingProperty;
7711+
public static new readonly System.Windows.DependencyProperty IsVirtualizingProperty;
77127712
public static readonly System.Windows.DependencyProperty OrientationProperty;
7713-
public static readonly new System.Windows.DependencyProperty VirtualizationModeProperty;
7713+
public static new readonly System.Windows.DependencyProperty VirtualizationModeProperty;
77147714
public VirtualizingStackPanel() { }
77157715
protected override bool CanHierarchicallyScrollAndVirtualizeCore { get { throw null; } }
77167716
[System.ComponentModel.DefaultValueAttribute(false)]

src/Microsoft.DotNet.Wpf/src/.editorconfig

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -167,9 +167,6 @@ dotnet_diagnostic.IDE0005.severity = suggestion
167167
# IDE0034: Simplify 'default' expression
168168
dotnet_diagnostic.IDE0034.severity = suggestion
169169

170-
# IDE0036: Order modifiers
171-
dotnet_diagnostic.IDE0036.severity = suggestion
172-
173170
# IDE0041: Use 'is null' check
174171
dotnet_diagnostic.IDE0041.severity = suggestion
175172

src/Microsoft.DotNet.Wpf/src/Common/Graphics/exports.cs

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Licensed to the .NET Foundation under one or more agreements.
1+
// Licensed to the .NET Foundation under one or more agreements.
22
// The .NET Foundation licenses this file to you under the MIT license.
33

44
//
@@ -150,41 +150,41 @@ internal static extern int WgxConnection_SameThreadPresent(
150150
internal static extern int MilChannel_GetMarshalType(IntPtr channelHandle, out ChannelMarshalType marshalType);
151151

152152
[DllImport (DllImport.MilCore, EntryPoint = "MilResource_SendCommand")]//CASRemoval:
153-
unsafe internal static extern int MilResource_SendCommand(
153+
internal static extern unsafe int MilResource_SendCommand(
154154
byte *pbData,
155155
uint cbSize,
156156
bool sendInSeparateBatch,
157157
IntPtr pChannel);
158158

159159
[DllImport (DllImport.MilCore, EntryPoint = "MilChannel_BeginCommand")]//CASRemoval:
160-
unsafe internal static extern int MilChannel_BeginCommand(
160+
internal static extern unsafe int MilChannel_BeginCommand(
161161
IntPtr pChannel,
162162
byte *pbData,
163163
uint cbSize,
164164
uint cbExtra
165165
);
166166

167167
[DllImport (DllImport.MilCore, EntryPoint = "MilChannel_AppendCommandData")]//CASRemoval:
168-
unsafe internal static extern int MilChannel_AppendCommandData(
168+
internal static extern unsafe int MilChannel_AppendCommandData(
169169
IntPtr pChannel,
170170
byte *pbData,
171171
uint cbSize
172172
);
173173

174174
[DllImport (DllImport.MilCore, EntryPoint = "MilChannel_EndCommand")]//CASRemoval:
175-
unsafe internal static extern int MilChannel_EndCommand(
175+
internal static extern unsafe int MilChannel_EndCommand(
176176
IntPtr pChannel);
177177

178178
[DllImport (DllImport.MilCore, EntryPoint = "MilResource_SendCommandMedia")]//CASRemoval:
179-
unsafe internal static extern int MilResource_SendCommandMedia(
179+
internal static extern unsafe int MilResource_SendCommandMedia(
180180
ResourceHandle handle,
181181
SafeMediaHandle pMedia,
182182
IntPtr pChannel,
183183
bool notifyUceDirect
184184
);
185185

186186
[DllImport (DllImport.MilCore, EntryPoint = "MilResource_SendCommandBitmapSource")]//CASRemoval:
187-
unsafe internal static extern int MilResource_SendCommandBitmapSource(
187+
internal static extern unsafe int MilResource_SendCommandBitmapSource(
188188
ResourceHandle handle,
189189
BitmapSourceSafeMILHandle /* IWICBitmapSource */ pBitmapSource,
190190
IntPtr pChannel);
@@ -619,7 +619,7 @@ internal bool IsOutOfBandChannel
619619
/// <summary>
620620
/// SendCommand sends a command struct through the composition thread.
621621
/// </summary>
622 10000 -
unsafe internal void SendCommand(
622+
internal unsafe void SendCommand(
623623
byte *pCommandData,
624624
int cSize)
625625
{
@@ -632,7 +632,7 @@ unsafe internal void SendCommand(
632632
/// current open batch, or whether it will be added to a new and separate batch
633633
/// which is then immediately closed, leaving the current batch untouched.
634634
/// </summary>
635-
unsafe internal void SendCommand(
635+
internal unsafe void SendCommand(
636636
byte *pCommandData,
637637
int cSize,
638638
bool sendInSeparateBatch)
@@ -668,7 +668,7 @@ unsafe internal void SendCommand(
668668
/// <summary>
669669
/// BeginCommand opens a command on a channel
670670
/// </summary>
671-
unsafe internal void BeginCommand(
671+
internal unsafe void BeginCommand(
672672
byte *pbCommandData,
673673
int cbSize,
674674
int cbExtra)
@@ -705,7 +705,7 @@ unsafe internal void BeginCommand(
705705
/// <summary>
706706
/// AppendCommandData appends data to an open command on a channel
707707
/// </summary>
708-
unsafe internal void AppendCommandData(
708+
internal unsafe void AppendCommandData(
709709
byte *pbCommandData,
710710
int cbSize)
711711
{

src/Microsoft.DotNet.Wpf/src/Common/Graphics/wgx_core_types.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Licensed to the .NET Foundation under one or more agreements.
1+
// Licensed to the .NET Foundation under one or more agreements.
22
// The .NET Foundation licenses this file to you under the MIT license.
33

44
using System.Runtime.InteropServices;
@@ -910,15 +910,15 @@ internal MilRectD(double left, double top, double right, double bottom)
910910
_bottom = bottom;
911911
}
912912

913-
static internal MilRectD Empty
913+
internal static MilRectD Empty
914914
{
915915
get
916916
{
917917
return new MilRectD(0,0,0,0);
918918
}
919919
}
920920

921-
static internal MilRectD NaN
921+
internal static MilRectD NaN
922922
{
923923
get
924924
{

src/Microsoft.DotNet.Wpf/src/PresentationCore/MS/Win32/UnsafeNativeMethodsTablet.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Licensed to the .NET Foundation under one or more agreements.
1+
// Licensed to the .NET Foundation under one or more agreements.
22
// The .NET Foundation licenses this file to you under the MIT license.
33

44

@@ -85,7 +85,7 @@ public override bool IsInvalid
8585
}
8686
}
8787

88-
override protected bool ReleaseHandle()
88+
protected override bool ReleaseHandle()
8989
{
9090
Debug.Assert(handle != IntPtr.Zero);
9191
return (MS.Internal.HRESULT.Succeeded(MS.Win32.Recognizer.UnsafeNativeMethods.DestroyRecognizer(handle)));
@@ -120,7 +120,7 @@ public override bool IsInvalid
120120
}
121121
}
122122

123-
override protected bool ReleaseHandle()
123+
protected override bool ReleaseHandle()
124124
{
125125
//Note: It is not an error to have already called DestroyRecognizer
126126
//which makes _recognizerHandle.IsInvalid == true before calling

src/Microsoft.DotNet.Wpf/src/PresentationCore/MS/internal/AppModel/CustomCredentialPolicy.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Licensed to the .NET Foundation under one or more agreements.
1+
// Licensed to the .NET Foundation under one or more agreements.
22
// The .NET Foundation licenses this file to you under the MIT license.
33

44
//
@@ -42,7 +42,7 @@ static CustomCredentialPolicy()
4242
_initialized = false;
4343
}
4444

45-
static internal void EnsureCustomCredentialPolicy()
45+
internal static void EnsureCustomCredentialPolicy()
4646
{
4747
if (!_initialized)
4848
{

src/Microsoft.DotNet.Wpf/src/PresentationCore/MS/internal/Automation/EventMap.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,7 @@ private static void NotifySources()
270270
}
271271

272272
private static Dictionary<int, EventInfo> _eventsTable; // key=event id, data=listener count
273-
private readonly static object _lock = new object();
273+
private static readonly object _lock = new object();
274274
}
275275
}
276276

src/Microsoft.DotNet.Wpf/src/PresentationCore/MS/internal/Automation/TextRangeProviderWrapper.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Licensed to the .NET Foundation under one or more agreements.
1+
// Licensed to the .NET Foundation under one or more agreements.
22
// The .NET Foundation licenses this file to you under the MIT license.
33

44
// Description: TextRange provider wrapper for WCP
@@ -165,7 +165,7 @@ public IRawElementProviderSimple[] GetChildren()
165165
#region Internal Methods
166166

167167
// Wrap arguments that are being returned, assuming they're not null or already wrapped.
168-
static internal ITextRangeProvider WrapArgument(ITextRangeProvider argument, AutomationPeer peer)
168+
internal static ITextRangeProvider WrapArgument(ITextRangeProvider argument, AutomationPeer peer)
169169
{
170170
if (argument == null)
171171
return null;
@@ -176,7 +176,7 @@ static internal ITextRangeProvider WrapArgument(ITextRangeProvider argument, Aut
176176
return new TextRangeProviderWrapper(peer, argument);
177177
}
178178

179-
static internal ITextRangeProvider [] WrapArgument(ITextRangeProvider [] argument, AutomationPeer peer)
179+
internal static ITextRangeProvider [] WrapArgument(ITextRangeProvider [] argument, AutomationPeer peer)
180180
{
181181
if (argument == null)
182182
return null;
@@ -193,7 +193,7 @@ static internal ITextRangeProvider [] WrapArgument(ITextRangeProvider [] argumen
193193
}
194194

195195
// Remove the wrapper from the argument if a wrapper exists
196-
static internal ITextRangeProvider UnwrapArgument(ITextRangeProvider argument)
196+
internal static ITextRangeProvider UnwrapArgument(ITextRangeProvider argument)
197197
{
198198
if (argument is TextRangeProviderWrapper)
199199
{

0 commit comments

Comments
 (0)
0