Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[StyleCleanUp] Add missing accessibility modifiers on members (IDE0040) #10021

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
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
Next Next commit
Add missing accessibility modifiers in System.Xaml
  • Loading branch information
h3xds1nz committed Jan 9, 2025
commit 4a607953c24287900dd2bcafd5b2b6b3a7e5fadc
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ namespace System.Xaml
{
public class AttachableMemberIdentifier : IEquatable<AttachableMemberIdentifier>
{
readonly Type declaringType;
readonly string memberName;
private readonly Type declaringType;
private readonly string memberName;

public AttachableMemberIdentifier(Type declaringType, string memberName)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ namespace System.Xaml
{
public static class AttachablePropertyServices
{
static DefaultAttachedPropertyStore attachedProperties = new DefaultAttachedPropertyStore();
private static DefaultAttachedPropertyStore attachedProperties = new DefaultAttachedPropertyStore();

public static int GetAttachedPropertyCount(object instance)
{
Expand Down Expand Up @@ -116,9 +116,9 @@ public static bool TryGetProperty<T>(object instance, AttachableMemberIdentifier
// global attached properties for types which don't implement IAttachedProperties or DO/Dependency Property
// integration for their attached properties.

sealed class DefaultAttachedPropertyStore
private sealed class DefaultAttachedPropertyStore
{
Lazy<ConditionalWeakTable<object, Dictionary<AttachableMemberIdentifier, object>>> instanceStorage =
private Lazy<ConditionalWeakTable<object, Dictionary<AttachableMemberIdentifier, object>>> instanceStorage =
new Lazy<ConditionalWeakTable<object, Dictionary<AttachableMemberIdentifier, object>>>();

public void CopyPropertiesTo(object instance, KeyValuePair<AttachableMemberIdentifier, object>[] array, int index)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,26 +16,26 @@ namespace MS.Internal.Xaml.Context
internal class NameFixupGraph
{
// Node -> out-edges (other objects the parent is dependent on)
Dictionary<object, FrugalObjectList<NameFixupToken>> _dependenciesByParentObject;
private Dictionary<object, FrugalObjectList<NameFixupToken>> _dependenciesByParentObject;

// Node -> in-edge (other object that is dependent on this child)
Dictionary<object, NameFixupToken> _dependenciesByChildObject;
private Dictionary<object, NameFixupToken> _dependenciesByChildObject;

// Node -> in-edges (other objects that are dependent on this name)
Dictionary<string, FrugalObjectList<NameFixupToken>> _dependenciesByName;
private Dictionary<string, FrugalObjectList<NameFixupToken>> _dependenciesByName;

// Queue of tokens whose dependencies have been resolved, and are awaiting processing
Queue<NameFixupToken> _resolvedTokensPendingProcessing;
private Queue<NameFixupToken> _resolvedTokensPendingProcessing;

// Token for a pending call to ProvideValue on the root object. Can't store this in
// _dependenciesByParentObject because it has no parent.
NameFixupToken _deferredRootProvideValue;
private NameFixupToken _deferredRootProvideValue;

// At the end of the parse, we start running reparses on partially initialized objects,
// and remove those dependencies. But we still want to be able to inform MEs/TCs that
// the named objects they're getting aren't actually fully initialized. So we save this list
// of incompletely initialized objects at the point we start completing references.
HashSet<object> _uninitializedObjectsAtParseEnd;
private HashSet <object> _uninitializedObjectsAtParseEnd;

public NameFixupGraph()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,8 @@ XamlException IAddLineInfo.WithLineInfo(XamlException ex)

internal class NameFixupToken : IAddLineInfo
{
List<string> _names;
List<XAML3.INameScopeDictionary> _nameScopeDictionaryList;
private List<string> _names;
private List<XAML3.INameScopeDictionary> _nameScopeDictionaryList;

public NameFixupToken()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,12 @@ internal class ObjectWriterContext : XamlContext
private XamlContextStack<ObjectWriterFrame> _stack;

private object _rootInstance;

ServiceProviderContext _serviceProviderContext;
XamlRuntime _runtime;
int _savedDepth; // The depth of the "saved" part this context is based on.
bool _nameResolutionComplete;
XamlObjectWriterSettings _settings;
List<NameScopeInitializationCompleteSubscriber> _nameScopeInitializationCompleteSubscribers;
private ServiceProviderContext _serviceProviderContext;
private XamlRuntime _runtime;
private int _savedDepth; // The depth of the "saved" part this context is based on.
private bool _nameResolutionComplete;
private XamlObjectWriterSettings _settings;
private List<NameScopeInitializationCompleteSubscriber> _nameScopeInitializationCompleteSubscribers;

public ObjectWriterContext(XamlSavedContext savedContext,
XamlObjectWriterSettings settings, XAML3.INameScope rootNameScope, XamlRuntime runtime)
Expand Down Expand Up @@ -1048,7 +1047,7 @@ internal void RaiseNameScopeInitializationCompleteEvent()

internal class NameScopeInitializationCompleteSubscriber
{
List<XAML3.INameScopeDictionary> _nameScopeDictionaryList = new List<XAML3.INameScopeDictionary>();
private List<XAML3.INameScopeDictionary> _nameScopeDictionaryList = new List<XAML3.INameScopeDictionary>();

public EventHandler Handler
{
Expand All @@ -1063,7 +1062,7 @@ public List<XAML3.INameScopeDictionary> NameScopeDictionaryList

private class StackWalkNameResolver : IXamlNameResolver
{
List<XAML3.INameScopeDictionary> _nameScopeDictionaryList;
private List<XAML3.INameScopeDictionary> _nameScopeDictionaryList;

public StackWalkNameResolver(List<XAML3.INameScopeDictionary> nameScopeDictionaryList)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ internal class ServiceProviderContext : ITypeDescriptorContext, // derives from
IDestinationTypeProvider,
IXamlLineInfo
{
ObjectWriterContext _xamlContext;
private ObjectWriterContext _xamlContext;

public ServiceProviderContext(ObjectWriterContext context)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ namespace MS.Internal.Xaml.Context
{
internal class XamlObjectWriterFactory: IXamlObjectWriterFactory
{
XamlSavedContext _savedContext;
XamlObjectWriterSettings _parentSettings;
private XamlSavedContext _savedContext;
private XamlObjectWriterSettings _parentSettings;

public XamlObjectWriterFactory(ObjectWriterContext context)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ IEnumerable<AmbientPropertyValue> GetAllAmbientValues(IEnumerable<XamlType> ceil

public class AmbientPropertyValue
{
XamlMember _property;
object _value;
private XamlMember _property;
private object _value;

public AmbientPropertyValue(XamlMember property, object value)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@ internal enum DeferringMode

internal class DeferringWriter : XamlWriter, IXamlLineInfoConsumer
{
DeferringMode _mode;
bool _handled;
ObjectWriterContext _context;
XamlNodeList _deferredList;
XamlWriter _deferredWriter;
IXamlLineInfoConsumer _deferredLineInfoConsumer;
int _deferredTreeDepth;
private DeferringMode _mode;
private bool _handled;
private ObjectWriterContext _context;
private XamlNodeList _deferredList;
private XamlWriter _deferredWriter;
private IXamlLineInfoConsumer _deferredLineInfoConsumer;
private int _deferredTreeDepth;

public DeferringWriter(ObjectWriterContext context)
{
Expand Down Expand Up @@ -70,7 +70,7 @@ public override void WriteStartObject(XamlType xamlType)
WriteObject(xamlType, false, "WriteStartObject");
}

void WriteObject(XamlType xamlType, bool fromMember, string methodName)
private void WriteObject(XamlType xamlType, bool fromMember, string methodName)
{
_handled = false;
switch (_mode)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ internal struct XamlNode
{
internal enum InternalNodeType:byte { None, StartOfStream, EndOfStream, EndOfAttributes, LineInfo }

XamlNodeType _nodeType;
InternalNodeType _internalNodeType;
private XamlNodeType _nodeType;
private InternalNodeType _internalNodeType;
private object _data;

public XamlNodeType NodeType
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ namespace System.Xaml
{
public class XamlObjectWriter : XamlWriter, IXamlLineInfoConsumer, IAddLineInfo, ICheckIfInitialized
{
object _lastInstance;
bool _inDispose;
ObjectWriterContext _context;
DeferringWriter _deferringWriter;
private object _lastInstance;
private bool _inDispose;
private ObjectWriterContext _context;
private DeferringWriter _deferringWriter;
private EventHandler<XamlObjectEventArgs> _afterBeginInitHandler;
private EventHandler<XamlObjectEventArgs> _beforePropertiesHandler;
private EventHandler<XamlObjectEventArgs> _afterPropertiesHandler;
Expand All @@ -31,12 +31,12 @@ public class XamlObjectWriter : XamlWriter, IXamlLineInfoConsumer, IAddLineInfo,

private object _rootObjectInstance;
private bool _skipDuplicatePropertyCheck;
NameFixupGraph _nameFixupGraph;
private NameFixupGraph _nameFixupGraph;
private Dictionary<object, List<PendingCollectionAdd>> _pendingCollectionAdds;
XAML3.INameScope _rootNamescope;
bool _skipProvideValueOnRoot;
bool _nextNodeMustBeEndMember;
bool _preferUnconvertedDictionaryKeys;
private XAML3.INameScope _rootNamescope;
private bool _skipProvideValueOnRoot;
private bool _nextNodeMustBeEndMember;
private bool _preferUnconvertedDictionaryKeys;
private Dictionary<object, ObjectWriterContext> _pendingKeyConversionContexts;

#if DEBUG
Expand Down Expand Up @@ -66,7 +66,7 @@ internal XamlObjectWriter(XamlSavedContext savedContext, XamlObjectWriterSetting
Initialize(savedContext.SchemaContext, savedContext, settings);
}

void Initialize(XamlSchemaContext schemaContext, XamlSavedContext savedContext, XamlObjectWriterSettings settings)
private void Initialize(XamlSchemaContext schemaContext, XamlSavedContext savedContext, XamlObjectWriterSettings settings)
{
_inDispose = false;
// ObjectWriter must be passed in a non-null SchemaContext. We check that here, since the CreateContext method
Expand Down Expand Up @@ -1093,7 +1093,7 @@ private XamlType GetXamlType(Type clrType)
}

// These are the all the directives that affect Construction of object.
bool IsConstructionDirective(XamlMember xamlMember)
private bool IsConstructionDirective(XamlMember xamlMember)
{
return xamlMember == XamlLanguage.Arguments
|| xamlMember == XamlLanguage.Base
Expand All @@ -1105,7 +1105,7 @@ bool IsConstructionDirective(XamlMember xamlMember)

// BAML sometimes sends the x:base directive later than it should
// so these are the Ctor Directives we worry about 'Users' messing up.
bool IsTextConstructionDirective(XamlMember xamlMember)
private bool IsTextConstructionDirective(XamlMember xamlMember)
{
return xamlMember == XamlLanguage.Arguments
|| xamlMember == XamlLanguage.FactoryMethod
Expand All @@ -1116,7 +1116,7 @@ bool IsTextConstructionDirective(XamlMember xamlMember)
// Non Ctor directives that are also allowed before object creation.
// These are compat issues with BAML recording x:Key x:Uid earlier than
// it current XAML standards.
bool IsDirectiveAllowedOnNullInstance(XamlMember xamlMember, XamlType xamlType)
private bool IsDirectiveAllowedOnNullInstance(XamlMember xamlMember, XamlType xamlType)
{
if (xamlMember == XamlLanguage.Key)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@ namespace System.Xaml
{
public class XamlXmlReader : XamlReader, IXamlLineInfo
{
XamlParserContext _context;
IEnumerator<XamlNode> _nodeStream;
private XamlParserContext _context;
private IEnumerator<XamlNode> _nodeStream;

XamlNode _current;
LineInfo _currentLineInfo;
XamlNode _endOfStreamNode;
private XamlNode _current;
private LineInfo _currentLineInfo;
private XamlNode _endOfStreamNode;

XamlXmlReaderSettings _mergedSettings;
private XamlXmlReaderSettings _mergedSettings;

public XamlXmlReader(XmlReader xmlReader)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ namespace System.Xaml.MS.Impl
[DebuggerDisplay("{ClrNamespace} {Assembly.FullName}")]
internal class AssemblyNamespacePair
{
WeakReference _assembly;
string _clrNamespace;
private WeakReference _assembly;
private string _clrNamespace;

public AssemblyNamespacePair(Assembly asm, string clrNamespace)
{
Expand Down
Loading