Skip to content

Commit fdf4b83

Browse files
committed
Merge branch 'main' into editorconfigCleanup2
2 parents 7ef9ccd + e9bc60b commit fdf4b83

15 files changed

+33
-42
lines changed

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

-9
Original file line numberDiff line numberDiff line change
@@ -311,18 +311,9 @@ dotnet_diagnostic.SA1121.severity = suggestion
311311
# SA1129: Do not use default value type constructor
312312
dotnet_diagnostic.SA1129.severity = suggestion
313313

314-
# SA1131: Constant values should appear on the right-hand side of comparisons
315-
dotnet_diagnostic.SA1131.severity = suggestion
316-
317314
# SA1400: Member should declare an access modifier
318315
dotnet_diagnostic.SA1400.severity = suggestion
319316

320-
# SA1404: Code analysis suppression should have justification
321-
dotnet_diagnostic.SA1404.severity = suggestion
322-
323-
# SA1408: Conditional expressions should declare precedence
324-
dotnet_diagnostic.SA1408.severity = suggestion
325-
326317
# SYSLIB1045: Convert to 'GeneratedRegexAttribute'.
327318
dotnet_diagnostic.SYSLIB1045.severity = suggestion
328319

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

+2-2
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ internal XamlType ServiceProvider_ResolveXamlType(string qName)
173173

174174
internal AmbientPropertyValue ServiceProvider_GetFirstAmbientValue(IEnumerable<XamlType> ceilingTypes, XamlMember[] properties)
175175
{
176-
List<AmbientPropertyValue> valueList = FindAmbientValues(ceilingTypes, /*searchLiveStackOnly*/false, /*types*/null, properties, true);
176+
List<AmbientPropertyValue> valueList = FindAmbientValues(ceilingTypes, searchLiveStackOnly: false, types: null, properties, true);
177177
return (valueList.Count == 0) ? null : valueList[0];
178178
}
179179

@@ -185,7 +185,7 @@ internal object ServiceProvider_GetFirstAmbientValue(XamlType[] types)
185185

186186
internal IEnumerable<AmbientPropertyValue> ServiceProvider_GetAllAmbientValues(IEnumerable<XamlType> ceilingTypes, XamlMember[] properties)
187187
{
188-
List<AmbientPropertyValue> valueList = FindAmbientValues(ceilingTypes, /*searchLiveStackOnly*/false, /*types*/null, properties, /*stopAfterFirst*/ false);
188+
List<AmbientPropertyValue> valueList = FindAmbientValues(ceilingTypes, searchLiveStackOnly: false, types: null, properties, stopAfterFirst: false);
189189
return valueList;
190190
}
191191

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

+4-4
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ private XamlRuntime CreateRuntime(XamlObjectWriterSettings settings, XamlSchemaC
131131

132132
if (result is null)
133133
{
134-
result = new ClrObjectRuntime(runtimeSettings, true /*isWriter*/);
134+
result = new ClrObjectRuntime(runtimeSettings, isWriter: true);
135135
}
136136

137137
result.LineInfo = this;
@@ -619,7 +619,7 @@ public override void WriteStartMember(XamlMember property)
619619

620620
// Duplicate Property Setting Check.
621621
//
622-
Logic_DuplicatePropertyCheck(_context, property, false /*onParent*/);
622+
Logic_DuplicatePropertyCheck(_context, property, onParent: false);
623623

624624
// If we haven't created the object yet then consider creating it now.
625625
// We need an object instance to set property values on.
@@ -1573,7 +1573,7 @@ private void Logic_ApplyCurrentPreconstructionPropertyValues(ObjectWriterContext
15731573
}
15741574
else
15751575
{
1576-
Logic_ApplyPropertyValue(ctx, prop, value, false /*onParent*/);
1576+
Logic_ApplyPropertyValue(ctx, prop, value, onParent: false);
15771577
}
15781578
}
15791579
}
@@ -2072,7 +2072,7 @@ private void Logic_DoAssignmentToParentProperty(ObjectWriterContext ctx)
20722072

20732073
if (!ctx.CurrentIsObjectFromMember)
20742074
{
2075-
Logic_ApplyPropertyValue(ctx, parentProperty, value, true /*onParent*/);
2075+
Logic_ApplyPropertyValue(ctx, parentProperty, value, onParent: true);
20762076

20772077
// registered a named object
20782078
if (parentProperty == parentType.GetAliasedProperty(XamlLanguage.Name))

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ private void Initialize(XmlReader givenXmlReader, XamlSchemaContext schemaContex
111111
_endOfStreamNode = new InternalNode(InternalNodeType.EndOfStream);
112112

113113
_context = (XamlParserContext)XamlContext.CreateContext(UsageMode.Parser, schemaContext,
114-
_mergedSettings.LocalAssembly, false /*ignoreCanConvert*/);
114+
_mergedSettings.LocalAssembly, ignoreCanConvert: false);
115115

116116
XamlScanner xamlScanner = new XamlScanner(_context, myXmlReader, _mergedSettings);
117117
XamlPullParser parser = new XamlPullParser(_context, xamlScanner, _mergedSettings);

src/Microsoft.DotNet.Wpf/src/System.Xaml/System/Xaml/Parser/MeScanner.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -327,15 +327,15 @@ private void ResolvePropertyName(string longName)
327327

328328
if (propName.IsDotted)
329329
{
330-
prop = _context.GetDottedProperty(tagType, tagNamespace, propName, false /*tagIsRoot*/);
330+
prop = _context.GetDottedProperty(tagType, tagNamespace, propName, tagIsRoot: false);
331331
}
332332

333333
// Regular property p
334334
else
335335
{
336336
string ns = _context.GetAttributeNamespace(propName, Namespace);
337337
declaringType = _context.CurrentType;
338-
prop = _context.GetNoDotAttributeProperty(declaringType, propName, Namespace, ns, false /*tagIsRoot*/);
338+
prop = _context.GetNoDotAttributeProperty(declaringType, propName, Namespace, ns, tagIsRoot: false);
339339
}
340340

341341
_tokenProperty = prop;

src/Microsoft.DotNet.Wpf/src/System.Xaml/System/Xaml/Parser/XamlAttribute.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ private XamlMember GetXamlAttributeProperty(XamlParserContext context, XamlPrope
153153
if (propName.IsDotted)
154154
{
155155
XamlType attachedOwnerType = new XamlType(string.Empty, propName.OwnerName, null, context.SchemaContext);
156-
unknownProperty = new XamlMember(propName.Name, attachedOwnerType, true /*isAttachable*/);
156+
unknownProperty = new XamlMember(propName.Name, attachedOwnerType, isAttachable: true);
157157
}
158158
else
159159
{

src/Microsoft.DotNet.Wpf/src/System.Xaml/System/Xaml/Runtime/DynamicMethodRuntime.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -126,15 +126,15 @@ private Dictionary<Type, DelegateCreator> DelegateCreators
126126

127127
internal DynamicMethodRuntime(XamlRuntimeSettings settings, XamlSchemaContext schemaContext,
128128
XamlAccessLevel accessLevel)
129-
: base(settings, true /*isWriter*/)
129+
: base(settings, isWriter: true)
130130
{
131131
Debug.Assert(schemaContext is not null);
132132
Debug.Assert(accessLevel is not null);
133133
_schemaContext = schemaContext;
134134
_localAssembly = Assembly.Load(accessLevel.AssemblyAccessToAssemblyName);
135135
if (accessLevel.PrivateAccessToTypeName is not null)
136136
{
137-
_localType = _localAssembly.GetType(accessLevel.PrivateAccessToTypeName, true /*throwOnError*/);
137+
_localType = _localAssembly.GetType(accessLevel.PrivateAccessToTypeName, throwOnError: true);
138138
}
139139
}
140140

src/Microsoft.DotNet.Wpf/src/System.Xaml/System/Xaml/Runtime/PartialTrustTolerantRuntime.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ class PartialTrustTolerantRuntime : XamlRuntime
3737

3838
public PartialTrustTolerantRuntime(XamlRuntimeSettings runtimeSettings, XamlAccessLevel accessLevel, XamlSchemaContext schemaContext)
3939
{
40-
_transparentRuntime = new ClrObjectRuntime(runtimeSettings, true /*isWriter*/);
40+
_transparentRuntime = new ClrObjectRuntime(runtimeSettings, isWriter: true);
4141
_accessLevel = accessLevel;
4242
_schemaContext = schemaContext;
4343
}

src/Microsoft.DotNet.Wpf/src/System.Xaml/System/Xaml/Schema/CollectionReflector.cs

+4-4
Original file line numberDiff line numberDiff line change
@@ -67,12 +67,12 @@ internal static XamlCollectionKind LookupCollectionKind(Type type, out MethodInf
6767
}
6868

6969
// If the type doesn't match any of the interfaces, check for Add methods
70-
if (TryGetDictionaryAdder(type, false /*mayBeIDictionary*/, out addMethod))
70+
if (TryGetDictionaryAdder(type, mayBeIDictionary: false, out addMethod))
7171
{
7272
return XamlCollectionKind.Dictionary;
7373
}
7474

75-
if (TryGetCollectionAdder(type, false /*mayBeICollection*/, out addMethod))
75+
if (TryGetCollectionAdder(type, mayBeICollection: false, out addMethod))
7676
{
7777
return XamlCollectionKind.Collection;
7878
}
@@ -86,15 +86,15 @@ internal static MethodInfo LookupAddMethod(Type type, XamlCollectionKind collect
8686
switch (collectionKind)
8787
{
8888
case XamlCollectionKind.Collection:
89-
bool isCollection = TryGetCollectionAdder(type, true /*mayBeICollection*/, out result);
89+
bool isCollection = TryGetCollectionAdder(type, mayBeICollection: true, out result);
9090
if (isCollection && result is null)
9191
{
9292
throw new XamlSchemaException(SR.Format(SR.AmbiguousCollectionItemType, type));
9393
}
9494

9595
break;
9696
case XamlCollectionKind.Dictionary:
97-
bool isDictionary = TryGetDictionaryAdder(type, true /*mayBeIDictionary*/, out result);
97+
bool isDictionary = TryGetDictionaryAdder(type, mayBeIDictionary: true, out result);
9898
if (isDictionary && result is null)
9999
{
100100
throw new XamlSchemaException(SR.Format(SR.AmbiguousDictionaryItemType, type));

src/Microsoft.DotNet.Wpf/src/System.Xaml/System/Xaml/Schema/Reflector.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ public string GetAttributeString(Type attributeType, out bool checkedInherited)
6767
// Passes inherit=true for reasons explained in comment on XamlType.TryGetAttributeString
6868
checkedInherited = true;
6969

70-
object[] attributes = CustomAttributeProvider.GetCustomAttributes(attributeType, true /*inherit*/);
70+
object[] attributes = CustomAttributeProvider.GetCustomAttributes(attributeType, inherit: true);
7171
if (attributes.Length == 0)
7272
{
7373
return null;

src/Microsoft.DotNet.Wpf/src/System.Xaml/System/Xaml/Schema/TypeReflector.cs

+3-3
Original file line numberDiff line numberDiff line change
@@ -782,23 +782,23 @@ private List<MethodInfo> LookupStaticAdders(string name)
782782
string adderName = KnownStrings.Add + name + KnownStrings.Handler;
783783
MemberInfo[] adders = UnderlyingType.GetMember(adderName, MemberTypes.Method, AttachableProperties_BF);
784784
List<MethodInfo> preferredAdders, otherAdders;
785-
PrioritizeAccessors(adders, true /*isEvent*/, false /*isGetter*/, out preferredAdders, out otherAdders);
785+
PrioritizeAccessors(adders, isEvent: true, isGetter: false, out preferredAdders, out otherAdders);
786786
return preferredAdders ?? otherAdders;
787787
}
788788

789789
private List<MethodInfo> LookupStaticGetters(string name)
790790
{
791791
MemberInfo[] getters = UnderlyingType.GetMember(KnownStrings.Get + name, MemberTypes.Method, AttachableProperties_BF);
792792
List<MethodInfo> preferredGetters, otherGetters;
793-
PrioritizeAccessors(getters, false /*isEvent*/, true /*isGetter*/, out preferredGetters, out otherGetters);
793+
PrioritizeAccessors(getters, isEvent: false, isGetter: true, out preferredGetters, out otherGetters);
794794
return preferredGetters ?? otherGetters;
795795
}
796796

797797
private List<MethodInfo> LookupStaticSetters(string name)
798798
{
799799
MemberInfo[] setters = UnderlyingType.GetMember(KnownStrings.Set + name, MemberTypes.Method, AttachableProperties_BF);
800800
List<MethodInfo> preferredSetters, otherSetters;
801-
PrioritizeAccessors(setters, false /*isEvent*/, false /*isGetter*/, out preferredSetters, out otherSetters);
801+
PrioritizeAccessors(setters, isEvent: false, isGetter: false, out preferredSetters, out otherSetters);
802802
return preferredSetters ?? otherSetters;
803803
}
804804

src/Microsoft.DotNet.Wpf/src/System.Xaml/System/Xaml/Schema/XmlNamespace.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ public override XamlProperty GetDirectiveProperty(string name)
7575
if (directive == null)
7676
{
7777
directive = new UnknownProperty(name,
78-
null, /*declaringType - xml directives don't have one. */
78+
declaringType: null, /* xml directives don't have a declaring type. */
7979
XmlDirectives.Uri);
8080
}
8181
return directive;

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

+4-4
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ public XamlMember(PropertyInfo propertyInfo, XamlSchemaContext schemaContext)
4545
}
4646

4747
public XamlMember(PropertyInfo propertyInfo, XamlSchemaContext schemaContext, XamlMemberInvoker invoker)
48-
: this(propertyInfo, schemaContext, invoker, new MemberReflector(false /*isEvent*/))
48+
: this(propertyInfo, schemaContext, invoker, new MemberReflector(isEvent: false))
4949
{
5050
}
5151

@@ -68,7 +68,7 @@ public XamlMember(EventInfo eventInfo, XamlSchemaContext schemaContext)
6868
}
6969

7070
public XamlMember(EventInfo eventInfo, XamlSchemaContext schemaContext, XamlMemberInvoker invoker)
71-
:this(eventInfo, schemaContext, invoker, new MemberReflector(true /*isEvent*/))
71+
:this(eventInfo, schemaContext, invoker, new MemberReflector(isEvent: true))
7272
{
7373
}
7474

@@ -93,7 +93,7 @@ public XamlMember(string attachablePropertyName, MethodInfo getter, MethodInfo s
9393

9494
public XamlMember(string attachablePropertyName, MethodInfo getter, MethodInfo setter,
9595
XamlSchemaContext schemaContext, XamlMemberInvoker invoker)
96-
:this(attachablePropertyName, getter, setter, schemaContext, invoker, new MemberReflector(getter, setter, false /*isEvent*/))
96+
:this(attachablePropertyName, getter, setter, schemaContext, invoker, new MemberReflector(getter, setter, isEvent: false))
9797
{
9898
}
9999

@@ -127,7 +127,7 @@ public XamlMember(string attachableEventName, MethodInfo adder, XamlSchemaContex
127127

128128
public XamlMember(string attachableEventName, MethodInfo adder, XamlSchemaContext schemaContext,
129129
XamlMemberInvoker invoker)
130-
: this(attachableEventName, adder, schemaContext, invoker, new MemberReflector(null, adder, true /*isEvent*/))
130+
: this(attachableEventName, adder, schemaContext, invoker, new MemberReflector(null, adder, isEvent: true))
131131
{
132132
}
133133

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

+3-3
Original file line numberDiff line numberDiff line change
@@ -534,7 +534,7 @@ public static MemberMarkupInfo ForProperty(
534534

535535
static MemberMarkupInfo ForSequence(object source, XamlMember property, SerializerContext context, bool isAttachable)
536536
{
537-
var itemsInfo = ForSequenceItems(source, isAttachable ? null : property, property.Type, context, false /*allowReadOnly*/);
537+
var itemsInfo = ForSequenceItems(source, isAttachable ? null : property, property.Type, context, allowReadOnly: false);
538538
if (itemsInfo is not null && itemsInfo.Children.Count != 0)
539539
{
540540
return new MemberMarkupInfo
@@ -1206,7 +1206,7 @@ void AddItemsProperty(object value, SerializerContext context, XamlType xamlType
12061206
}
12071207
else if (xamlType.IsCollection)
12081208
{
1209-
propertyInfo = MemberMarkupInfo.ForSequenceItems(value, null, xamlType, context, true /*allowReadOnly*/);
1209+
propertyInfo = MemberMarkupInfo.ForSequenceItems(value, null, xamlType, context, allowReadOnly: true);
12101210
}
12111211

12121212
if (propertyInfo is not null && propertyInfo.Children.Count != 0)
@@ -2512,7 +2512,7 @@ public SerializerContext(XamlSchemaContext schemaContext, XamlObjectReaderSettin
25122512
prefixToNamespaceMap = new Dictionary<string, string>();
25132513
ReferenceTable = new ReferenceTable(null);
25142514
this.schemaContext = schemaContext;
2515-
runtime = new ClrObjectRuntime(null, false /*isWriter*/);
2515+
runtime = new ClrObjectRuntime(null, isWriter: false);
25162516
this.settings = settings;
25172517
}
25182518

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

+4-4
Original file line numberDiff line numberDiff line change
@@ -353,7 +353,7 @@ public XamlMember GetMember(string name)
353353
XamlMember result;
354354
if (!_reflector.Members.TryGetValue(name, out result) && !_reflector.Members.IsComplete)
355355
{
356-
result = LookupMember(name, false /*skipReadOnlyCheck*/);
356+
result = LookupMember(name, skipReadOnlyCheck: false);
357357
result = _reflector.Members.TryAdd(name, result);
358358
}
359359

@@ -806,8 +806,8 @@ protected virtual XamlMember LookupContentProperty()
806806
{
807807
return null;
808808
}
809-
810-
return GetPropertyOrUnknown(contentPropertyName, false /*skipReadOnlyCheck*/);
809+
810+
return GetPropertyOrUnknown(contentPropertyName, skipReadOnlyCheck: false);
811811
}
812812

813813
if (BaseType is not null)
@@ -1538,7 +1538,7 @@ private XamlMember GetPropertyOrUnknown(string propertyName, bool skipReadOnlyCh
15381538
XamlMember result = skipReadOnlyCheck ? LookupMember(propertyName, true) : GetMember(propertyName);
15391539
if (result is null)
15401540
{
1541-
result = new XamlMember(propertyName, this /*declaringType*/, false /*isAttachable*/);
1541+
result = new XamlMember(propertyName, declaringType: this, isAttachable: false);
15421542
}
15431543

15441544
return result;

0 commit comments

Comments
 (0)