8000 Add missing accessibility modifiers in System.Xaml · dotnet/wpf@16c26f2 · GitHub
[go: up one dir, main page]

Skip to content

Commit 16c26f2

Browse files
committed
Add missing accessibility modifiers in System.Xaml
1 parent 13c81c7 commit 16c26f2

Some content is hidden

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

44 files changed

+518
-551
lines changed

src/Microsoft.DotNet.Wpf/src/System.Xaml/System/Xaml/AttachableMemberIdentifier.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ namespace System.Xaml
88
{
99
public class AttachableMemberIdentifier : IEquatable<AttachableMemberIdentifier>
1010
{
11-
readonly Type declaringType;
12-
readonly string memberName;
11+
private readonly Type declaringType;
12+
private readonly string memberName;
1313

1414
public AttachableMemberIdentifier(Type declaringType, string memberName)
1515
{

src/Microsoft.DotNet.Wpf/src/System.Xaml/System/Xaml/AttachablePropertyServices.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ namespace System.Xaml
1212
{
1313
public static class AttachablePropertyServices
1414
{
15-
static DefaultAttachedPropertyStore attachedProperties = new DefaultAttachedPropertyStore();
15+
private static DefaultAttachedPropertyStore attachedProperties = new DefaultAttachedPropertyStore();
1616

1717
public static int GetAttachedPropertyCount(object instance)
1818
{
@@ -121,9 +121,9 @@ public static bool TryGetProperty<T>(object instance, AttachableMemberIdentifier
121121
// global attached properties for types which don't implement IAttachedProperties or DO/Dependency Property
122122
// integration for their attached properties.
123123

124-
sealed class DefaultAttachedPropertyStore
124+
private sealed class DefaultAttachedPropertyStore
125125
{
126-
Lazy<ConditionalWeakTable<object, Dictionary<AttachableMemberIdentifier, object>>> instanceStorage =
126+
private Lazy<ConditionalWeakTable<object, Dictionary<AttachableMemberIdentifier, object>>> instanceStorage =
127127
new Lazy<ConditionalWeakTable<object, Dictionary<AttachableMemberIdentifier, object>>>();
128128

129129
public void CopyPropertiesTo(object instance, KeyValuePair<AttachableMemberIdentifier, object>[] array, int index)

src/Microsoft.DotNet.Wpf/src/System.Xaml/System/Xaml/Context/NameFixupGraph.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,26 +20,26 @@ namespace MS.Internal.Xaml.Context
2020
internal class NameFixupGraph
2121
{
2222
// Node -> out-edges (other objects the parent is dependent on)
23-
Dictionary<object, FrugalObjectList<NameFixupToken>> _dependenciesByParentObject;
23+
private Dictionary<object, FrugalObjectList<NameFixupToken>> _dependenciesByParentObject;
2424

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

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

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

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

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

4444
public NameFixupGraph()
4545
{

src/Microsoft.DotNet.Wpf/src/System.Xaml/System/Xaml/Context/NameFixupToken.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,8 +102,8 @@ XamlException IAddLineInfo.WithLineInfo(XamlException ex)
102102

103103
internal class NameFixupToken : IAddLineInfo
104104
{
105-
List<string> _names;
106-
List<XAML3.INameScopeDictionary> _nameScopeDictionaryList;
105+
private List<string> _names;
106+
private List<XAML3.INameScopeDictionary> _nameScopeDictionaryList;
107107

108108
public NameFixupToken()
109109
{

src/Microsoft.DotNet.Wpf/src/System.Xaml/System/Xaml/Context/ObjectWriterContext.cs

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,12 @@ internal class ObjectWriterContext : XamlContext
2020
private XamlContextStack<ObjectWriterFrame 10BC0 > _stack;
2121

2222
private object _rootInstance;
23-
24-
ServiceProviderContext _serviceProviderContext;
25-
XamlRuntime _runtime;
26-
int _savedDepth; // The depth of the "saved" part this context is based on.
27-
bool _nameResolutionComplete;
28-
XamlObjectWriterSettings _settings;
29-
List<NameScopeInitializationCompleteSubscriber> _nameScopeInitializationCompleteSubscribers;
23+
private ServiceProviderContext _serviceProviderContext;
24+
private XamlRuntime _runtime;
25+
private int _savedDepth; // The depth of the "saved" part this context is based on.
26+
private bool _nameResolutionComplete;
27+
private XamlObjectWriterSettings _settings;
28+
private List<NameScopeInitializationCompleteSubscriber> _nameScopeInitializationCompleteSubscribers;
3029

3130
public ObjectWriterContext(XamlSavedContext savedContext,
3231
XamlObjectWriterSettings settings, XAML3.INameScope rootNameScope, XamlRuntime runtime)
@@ -1030,7 +1029,7 @@ internal void RaiseNameScopeInitializationCompleteEvent()
10301029

10311030
internal class NameScopeInitializationCompleteSubscriber
10321031
{
1033-
List<XAML3.INameScopeDictionary> _nameScopeDictionaryList = new List<XAML3.INameScopeDictionary>();
1032+
private List<XAML3.INameScopeDictionary> _nameScopeDictionaryList = new List<XAML3.INameScopeDictionary>();
10341033

10351034
public EventHandler Handler
10361035
{
@@ -1045,7 +1044,7 @@ public List<XAML3.INameScopeDictionary> NameScopeDictionaryList
10451044

10461045
private class StackWalkNameResolver : IXamlNameResolver
10471046
{
1048-
List<XAML3.INameScopeDictionary> _nameScopeDictionaryList;
1047+
private List<XAML3.INameScopeDictionary> _nameScopeDictionaryList;
10491048

10501049
public StackWalkNameResolver(List<XAML3.INameScopeDictionary> nameScopeDictionaryList)
10511050
{

src/Microsoft.DotNet.Wpf/src/System.Xaml/System/Xaml/Context/ServiceProviderContext.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ internal class ServiceProviderContext : ITypeDescriptorContext, // derives from
2626
IDestinationTypeProvider,
2727
IXamlLineInfo
2828
{
29-
ObjectWriterContext _xamlContext;
29+
private ObjectWriterContext _xamlContext;
3030

3131
public ServiceProviderContext(ObjectWriterContext context)
3232
{

src/Microsoft.DotNet.Wpf/src/System.Xaml/System/Xaml/Context/XamlObjectWriterFactory.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ namespace MS.Internal.Xaml.Context
1010
{
1111
internal class XamlObjectWriterFactory: IXamlObjectWriterFactory
1212
{
13-
XamlSavedContext _savedContext;
14-
XamlObjectWriterSettings _parentSettings;
13+
private XamlSavedContext _savedContext;
14+
private XamlObjectWriterSettings _parentSettings;
1515

1616
public XamlObjectWriterFactory(ObjectWriterContext context)
1717
{

src/Microsoft.DotNet.Wpf/src/System.Xaml/System/Xaml/IAmbientProvider.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ IEnumerable<AmbientPropertyValue> GetAllAmbientValues(IEnumerable<XamlType> ceil
2727

2828
public class AmbientPropertyValue
2929
{
30-
XamlMember _property;
31-
object _value;
30+
private XamlMember _property;
31+
private object _value;
3232

3333
public AmbientPropertyValue(XamlMember property, object value)
3434
{

src/Microsoft.DotNet.Wpf/src/System.Xaml/System/Xaml/InfosetObjects/DeferredWriter.cs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,13 @@ internal enum DeferringMode
1919

2020
internal class DeferringWriter : XamlWriter, IXamlLineInfoConsumer
2121
{
22-
DeferringMode _mode;
23-
bool _handled;
24-
ObjectWriterContext _context;
25-
XamlNodeList _deferredList;
26-
XamlWriter _deferredWriter;
27-
IXamlLineInfoConsumer _deferredLineInfoConsumer;
28-
int _deferredTreeDepth;
22+
private DeferringMode _mode;
23+
private bool _handled;
24+
private ObjectWriterContext _context;
25+
private XamlNodeList _deferredList;
26+
private XamlWriter _deferredWriter;
27+
private IXamlLineInfoConsumer _deferredLineInfoConsumer;
28+
private int _deferredTreeDepth;
2929

3030
public DeferringWriter(ObjectWriterContext context)
3131
{
@@ -71,7 +71,7 @@ public override void WriteStartObject(XamlType xamlType)
7171
WriteObject(xamlType, false, "WriteStartObject");
7272
}
7373

74-
void WriteObject(XamlType xamlType, bool fromMember, string methodName)
74+
private void WriteObject(XamlType xamlType, bool fromMember, string methodName)
7575
{
7676
_handled = false;
7777
switch (_mode)

src/Microsoft.DotNet.Wpf/src/System.Xaml/System/Xaml/InfosetObjects/XamlNodes.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@ internal struct XamlNode
3030
{
3131
internal enum InternalNodeType:byte { None, StartOfStream, EndOfStream, EndOfAttributes, LineInfo }
3232

33-
XamlNodeType _nodeType;
34-
InternalNodeType _internalNodeType;
33+
private XamlNodeType _nodeType;
34+
private InternalNodeType _internalNodeType;
3535
private object _data;
3636

3737
public XamlNodeType NodeType

src/Microsoft.DotNet.Wpf/src/System.Xaml/System/Xaml/InfosetObjects/XamlObjectWriter.cs

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,10 @@ namespace System.Xaml
2222
{
2323
public class XamlObjectWriter : XamlWriter, IXamlLineInfoConsumer, IAddLineInfo, ICheckIfInitialized
2424
{
25-
object _lastInstance;
26-
bool _inDispose;
27-
ObjectWriterContext _context;
28-
DeferringWriter _deferringWriter;
25+
private object _lastInstance;
26+
private bool _inDispose;
27+
private ObjectWriterContext _context;
28+
private DeferringWriter _deferringWriter;
2929
private EventHandler<XamlObjectEventArgs> _afterBeginInitHandler;
3030
private EventHandler<XamlObjectEventArgs> _beforePropertiesHandler;
3131
private EventHandler<XamlObjectEventArgs> _afterPropertiesHandler;
@@ -34,12 +34,12 @@ public class XamlObjectWriter : XamlWriter, IXamlLineInfoConsumer, IAddLineInfo,
3434

3535
private object _rootObjectInstance;
3636
private bool _skipDuplicatePropertyCheck;
37-
NameFixupGraph _nameFixupGraph;
37+
private NameFixupGraph _nameFixupGraph;
3838
private Dictionary<object, List<PendingCollectionAdd>> _pendingCollectionAdds;
39-
XAML3.INameScope _rootNamescope;
40-
bool _skipProvideValueOnRoot;
41-
bool _nextNodeMustBeEndMember;
42-
bool _preferUnconvertedDictionaryKeys;
39+
private XAML3.INameScope _rootNamescope;
40+
private bool _skipProvideValueOnRoot;
41+
private bool _nextNodeMustBeEndMember;
42+
private bool _preferUnconvertedDictionaryKeys;
4343
private Dictionary<object, ObjectWriterContext> _pendingKeyConversionContexts;
4444

4545
#if DEBUG
@@ -68,7 +68,7 @@ internal XamlObjectWriter(XamlSavedContext savedContext, XamlObjectWriterSetting
6868
Initialize(savedContext.SchemaContext, savedContext, settings);
6969
}
7070

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

10671067
// These are the all the directives that affect Construction of object.
1068-
bool IsConstructionDirective(XamlMember xamlMember)
1068+
private bool IsConstructionDirective(XamlMember xamlMember)
10691069
{
10701070
return xamlMember == XamlLanguage.Arguments
10711071
|| xamlMember == XamlLanguage.Base
@@ -1077,7 +1077,7 @@ bool IsConstructionDirective(XamlMember xamlMember)
10771077

10781078
// BAML sometimes sends the x:base directive later than it should
10791079
// so these are the Ctor Directives we worry about 'Users' messing up.
1080-
bool IsTextConstructionDirective(XamlMember xamlMember)
1080+
private bool IsTextConstructionDirective(XamlMember xamlMember)
10811081
{
10821082
return xamlMember == XamlLanguage.Arguments
10831083
|| xamlMember == XamlLanguage.FactoryMethod
@@ -1088,7 +1088,7 @@ bool IsTextConstructionDirective(XamlMember xamlMember)
10881088
// Non Ctor directives that are also allowed before object creation.
10891089
// These are compat issues with BAML recording x:Key x:Uid earlier than
10901090
// it current XAML standards.
1091-
bool IsDirectiveAllowedOnNullInstance(XamlMember xamlMember, XamlType xamlType)
1091+
private bool IsDirectiveAllowedOnNullInstance(XamlMember xamlMember, XamlType xamlType)
10921092
{
10931093
if (xamlMember == XamlLanguage.Key)
10941094
{

src/Microsoft.DotNet.Wpf/src/System.Xaml/System/Xaml/InfosetObjects/XamlXmlReader.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,14 @@ namespace System.Xaml
1818
{
1919
public class XamlXmlReader : XamlReader, IXamlLineInfo
2020
{
21-
XamlParserContext _context;
22-
IEnumerator<XamlNode> _nodeStream;
21+
private XamlParserContext _context;
22+
private IEnumerator<XamlNode> _nodeStream;
2323

24-
XamlNode _current;
25-
LineInfo _currentLineInfo;
26-
XamlNode _endOfStreamNode;
24+
private XamlNode _current;
25+
private LineInfo _currentLineInfo;
26+
private XamlNode _endOfStreamNode;
2727

28-
XamlXmlReaderSettings _mergedSettings;
28+
private XamlXmlReaderSettings _mergedSettings;
2929

3030
public XamlXmlReader(XmlReader xmlReader)
3131
{

src/Microsoft.DotNet.Wpf/src/System.Xaml/System/Xaml/MS/Impl/AssemblyNamespacePair.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ namespace System.Xaml.MS.Impl
1212
[DebuggerDisplay("{ClrNamespace} {Assembly.FullName}")]
1313
internal class AssemblyNamespacePair
1414
{
15-
WeakReference _assembly;
16-
String _clrNamespace;
15+
private WeakReference _assembly;
16+
private String _clrNamespace;
1717

1818
public AssemblyNamespacePair(Assembly asm, String clrNamespace)
1919
{

0 commit comments

Comments
 (0)
0