Skip to content

Commit b360342

Browse files
authored
[StyleCleanUp] Add missing accessibility modifiers on members (IDE0040) (#10021)
* Add missing accessibility modifiers in System.Xaml * Post merge changes * IDE0040 Part 1 with config removal * IDE0040 Final part cleanup * Remove SA1400 as well * Fix up release build * Fix post-merge issue * Fix IDE0040 in csp wrapper * Modify MilCodeGen to include accessibility modifiers
1 parent 36010c7 commit b360342

File tree

685 files changed

+3808
-4076
lines changed

Some content is hidden

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

685 files changed

+3808
-4076
lines changed

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

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -173,9 +173,6 @@ dotnet_diagnostic.IDE0034.severity = suggestion
173173
# IDE0036: Order modifiers
174174
dotnet_diagnostic.IDE0036.severity = suggestion
175175

176-
# IDE0040: Add accessibility modifiers
177-
dotnet_diagnostic.IDE0040.severity = suggestion
178-
179176
# IDE0041: Use 'is null' check
180177
dotnet_diagnostic.IDE0041.severity = suggestion
181178

@@ -250,10 +247,6 @@ dotnet_diagnostic.IDE1006.severity = suggestion
250247

251248
# SA1000: Spacing around keywords
252249
dotnet_diagnostic.SA1000.severity = suggestion
253-
254-
# SA1400: Member should declare an access modifier
255-
dotnet_diagnostic.SA1400.severity = suggestion
256-
257250
# SYSLIB1045: Convert to 'GeneratedRegexAttribute'.
258251
dotnet_diagnostic.SYSLIB1045.severity = suggestion
259252

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -323,13 +323,13 @@ internal sealed partial class Channel
323323
/// <summary>
324324
/// Primary channel.
325325
/// </summary>
326-
IntPtr _hChannel;
326+
private IntPtr _hChannel;
327327

328328
private Channel _referenceChannel;
329329
private bool _isSynchronous;
330330
private bool _isOutOfBandChannel;
331331

332-
IntPtr _pConnection;
332+
private IntPtr _pConnection;
333333

334334
/// <summary>
335335
/// Creates a channel and associates it with channel group (partition).

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

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -584,7 +584,7 @@ internal enum ChildType
584584
eChildLast = 0x2
585585
};
586586

587-
enum MILResourceType
587+
internal enum MILResourceType
588588
{
589589
eMILResourceVideo = 0,
590590
eMILCOB = 1,
@@ -594,7 +594,7 @@ enum MILResourceType
594594
eMILResourceLast = 5
595595
};
596596

597-
enum MILAVInstructionType
597+
internal enum MILAVInstructionType
598598
{
599599
eAVPlay = 0,
600600
eAVStop,
@@ -658,61 +658,61 @@ internal enum WICComponentType
658658
[StructLayout(LayoutKind.Sequential)]
659659
internal struct WICBitmapPattern
660660
{
661-
Int64 Offset;
662-
UInt32 Length;
663-
IntPtr Pattern;
664-
IntPtr Mask;
661+
private Int64 Offset;
662+
private UInt32 Length;
663+
private IntPtr Pattern;
664+
private IntPtr Mask;
665665
}
666666

667667
[StructLayout(LayoutKind.Sequential)]
668668
internal struct MILBitmapItem
669669
{
670-
uint Size;
671-
IntPtr Desc;
672-
uint DescSize;
673-
IntPtr Data;
674-
uint DataSize;
675-
uint Cookie;
670+
private uint Size;
671+
private IntPtr Desc;
672+
private uint DescSize;
673+
private IntPtr Data;
674+
private uint DataSize;
675+
private uint Cookie;
676676
};
677677

678678
[StructLayout(LayoutKind.Sequential)]
679679
internal struct BitmapTransformCaps
680680
{
681681
// Size of this structure.
682682

683-
int nSize;
683+
private int nSize;
684684

685685
// minimum number of inputs required.
686686

687-
int cMinInputs;
687+
private int cMinInputs;
688688

689689
// maximum number of inputs that will be processed.
690690

691-
int cMaxInputs;
691+
private int cMaxInputs;
692692

693693
// Set to false requires all the inputs and the
694694
// output to have the same pixel format determined
695695
// by calling IsPixelFormatSupported() for any
696696
// index. Set to true allows different input/output
697697
// pixel formats.
698698

699-
[MarshalAs(UnmanagedType.Bool)] bool fSupportMultiFormat;
699+
[MarshalAs(UnmanagedType.Bool)] private bool fSupportMultiFormat;
700700

701701
// Supports auxilliary data out.
702702

703-
[MarshalAs(UnmanagedType.Bool)] bool fAuxiliaryData;
703+
[MarshalAs(UnmanagedType.Bool)] private bool fAuxiliaryData;
704704

705705
// TRUE if the effect supports multiple output
706706

707-
[MarshalAs(UnmanagedType.Bool)] bool fSupportMultiOutput;
707+
[MarshalAs(UnmanagedType.Bool)] private bool fSupportMultiOutput;
708708

709709
// TRUE if the effect can provide output band by band
710710

711-
[MarshalAs(UnmanagedType.Bool)] bool fSupportBanding;
711+
[MarshalAs(UnmanagedType.Bool)] private bool fSupportBanding;
712712

713713
// TRUE if the effect supports multi-resolution
714714

715-
[MarshalAs(UnmanagedType.Bool)] bool fSupportMultiResolution;
715+
[MarshalAs(UnmanagedType.Bool)] private bool fSupportMultiResolution;
716716
};
717717

718718
[StructLayout(LayoutKind.Sequential)]

src/Microsoft.DotNet.Wpf/src/Extensions/PresentationFramework-SystemCore/DynamicAccessorImpl.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,8 @@ public override void SetValue(object component, object value)
4444
_setter.Target(_setter, component, value);
4545
}
4646

47-
CallSite<Func<CallSite, object, object>> _getter;
48-
CallSite<Action<CallSite, object, object>> _setter;
47+
private CallSite<Func<CallSite, object, object>> _getter;
48+
private CallSite<Action<CallSite, object, object>> _setter;
4949
}
5050

5151
#endregion DynamicPropertyAccessorImpl
@@ -152,11 +152,11 @@ public static DynamicIndexerAccessor GetIndexerAccessor(int rank)
152152
return _accessors[rank-1];
153153
}
154154

155-
CallSite _getterCallSite, _setterCallSite;
156-
MulticastDelegate _getterDelegate, _setterDelegate;
155+
private CallSite _getterCallSite, _setterCallSite;
156+
private MulticastDelegate _getterDelegate, _setterDelegate;
157157

158-
static DynamicIndexerAccessor[] _accessors = new DynamicIndexerAccessor[1];
159-
static readonly object _lock = new object();
158+
private static DynamicIndexerAccessor[] _accessors = new DynamicIndexerAccessor[1];
159+
private static readonly object _lock = new object();
160160
}
161161

162162
#endregion DynamicIndexerAccessor

src/Microsoft.DotNet.Wpf/src/Extensions/PresentationFramework-SystemData/SystemDataExtension.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -220,11 +220,11 @@ public DataTableToDataViewLink(DataTable dataTable, object target)
220220
dataTable.Initialized += OnInitialized;
221221
}
222222

223-
void OnInitialized(object sender, EventArgs e)
223+
private void OnInitialized(object sender, EventArgs e)
224224
{
225225
}
226226

227-
object _target;
227+
private object _target;
228228
}
229229

230230
private class DataRowViewToRelatedViewLink
@@ -235,15 +235,15 @@ public DataRowViewToRelatedViewLink(DataRowView dataRowView, object target)
235235
dataRowView.PropertyChanged += OnPropertyChanged;
236236
}
237237

238-
void OnPropertyChanged(object sender, PropertyChangedEventArgs e)
238+
private void OnPropertyChanged(object sender, PropertyChangedEventArgs e)
239239
{
240240
}
241241

242-
object _target;
242+
private object _target;
243243
}
244244

245-
static Type s_DataTablePropertyDescriptorType;
246-
static Type s_DataRelationPropertyDescriptorType;
245+
private static Type s_DataTablePropertyDescriptorType;
246+
private static Type s_DataRelationPropertyDescriptorType;
247247
}
248248
}
249249

src/Microsoft.DotNet.Wpf/src/Extensions/PresentationFramework-SystemXml/XmlNodeComparer.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ int IComparer.Compare(object o1, object o2)
6060

6161
private SortDescriptionCollection _sortParameters;
6262
private XmlNamespaceManager _namespaceManager;
63-
CultureInfo _culture;
63+
private CultureInfo _culture;
6464
}
6565
}
6666

src/Microsoft.DotNet.Wpf/src/PresentationBuildTasks/MS/Internal/MarkupCompiler/MarkupCompiler.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -709,11 +709,11 @@ private SourceFileInfo OnSourceFileResolve(FileUnit file)
709709
return sourceFileInfo;
710710
}
711711

712-
#endregion CompileUnit
712+
#endregion CompileUnit
713713

714-
#region ErrorHandling
714+
#region ErrorHandling
715715

716-
static void ThrowCompilerException(string id)
716+
private static void ThrowCompilerException(string id)
717717
{
718718
string message = SR.GetResourceString(id);
719719
ThrowCompilerExceptionImpl(message);
@@ -737,13 +737,13 @@ internal static void ThrowCompilerException(string id, string value1, string val
737737
ThrowCompilerExceptionImpl(message);
738738
}
739739

740-
static void ThrowCompilerException(string id, string value1, string value2, string value3, string value4)
740+
private static void ThrowCompilerException(string id, string value1, string value2, string value3, string value4)
741741
{
742742
string message = SR.Format(SR.GetResourceString(id), value1, value2, value3, value4);
743743
ThrowCompilerExceptionImpl(message);
744744
}
745745

746-
static void ThrowCompilerExceptionImpl(string message)
746+
private static void ThrowCompilerExceptionImpl(string message)
747747
{
748748
Exception compilerException = new Exception(message);
749749
throw compilerException;

src/Microsoft.DotNet.Wpf/src/PresentationBuildTasks/MS/Internal/MarkupCompiler/ParserExtension.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -914,7 +914,7 @@ internal override bool CanResolveLocalAssemblies()
914914
return _pass2;
915915
}
916916

917-
bool ProcessedRootElement
917+
private bool ProcessedRootElement
918918
{
919919
get { return _processedRootElement; }
920920
set { _processedRootElement = value; }

src/Microsoft.DotNet.Wpf/src/PresentationBuildTasks/MS/Internal/MarkupCompiler/VersionHelper.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ namespace MS.Internal
1414
{
1515
internal static class VersionHelper
1616
{
17-
static readonly Version NullVersion = new Version(0, 0, 0, 0);
17+
private static readonly Version NullVersion = new Version(0, 0, 0, 0);
1818

1919
/// <summary>
2020
/// Parses a version string of the form "major [ '.' minor [ '.' build [ '.' revision ] ] ]".

src/Microsoft.DotNet.Wpf/src/PresentationBuildTasks/Microsoft/Build/Tasks/Windows/GenerateTemporaryTargetAssembly.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -866,7 +866,7 @@ private static void ReplaceImplicitImports(XmlDocument xmlProjectDoc)
866866
// Creates an XmlNode that contains an Import Project element
867867
//
868868
// <Import Project="Sdk.props" Sdk="Microsoft.NET.Sdk" />
869-
static XmlNode CreateImportProjectSdkNode(XmlDocument xmlProjectDoc, string projectAttributeValue, SdkReference sdkReference)
869+
private static XmlNode CreateImportProjectSdkNode(XmlDocument xmlProjectDoc, string projectAttributeValue, SdkReference sdkReference)
870870
{
871871
XmlNode nodeImport = xmlProjectDoc.CreateElement("Import", xmlProjectDoc.DocumentElement.NamespaceURI);
872872
XmlAttribute projectAttribute = xmlProjectDoc.CreateAttribute("Project");

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323

2424
namespace MS.Internal.AppModel
2525
{
26-
static class CookieHandler
26+
internal static class CookieHandler
2727
{
2828
internal static void HandleWebRequest(WebRequest request)
2929
{

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -217,9 +217,9 @@ private Stream HandleWebSource(bool onlyNeedContentType)
217217

218218
#region Private Members
219219

220-
Uri _absoluteLocation = null;
221-
ContentType _contentType = MS.Internal.ContentType.Empty;
222-
Stream _cacheStream = null;
220+
private Uri _absoluteLocation = null;
221+
private ContentType _contentType = MS.Internal.ContentType.Empty;
222+
private Stream _cacheStream = null;
223223
private Object _globalLock = new Object();
224224

225225
#endregion Private Members

src/Microsoft.DotNet.Wpf/src/PresentationCore/MS/internal/FontCache/FontFaceLayoutInfo.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,9 @@ internal sealed class FontFaceLayoutInfo
3838
private byte[] _gpos;
3939
private byte[] _gdef;
4040

41-
Text.TextInterface.Font _font;
41+
private Text.TextInterface.Font _font;
4242

43-
ushort _blankGlyphIndex;
43+
private ushort _blankGlyphIndex;
4444

4545

4646
//------------------------------------------------------

0 commit comments

Comments
 (0)