Skip to content

Commit

Permalink
Cleanup: Use named arguments in WindowsBase.
Browse files Browse the repository at this point in the history
Automated changes.

Contributes to dotnet#10018
  • Loading branch information
ThomasGoulet73 committed Dec 30, 2024
1 parent c8c970b commit abdef5d
Show file tree
Hide file tree
Showing 8 changed files with 55 additions and 55 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,7 @@ internal sealed class ValidatedPartUri : Uri, IComparable<ValidatedPartUri>, IEq
#region Internal Constructors

internal ValidatedPartUri(string partUriString)
: this(partUriString, false /*isNormalized*/, true /*computeIsRelationship*/, false /*dummy value as we will compute it later*/)
: this(partUriString, isNormalized: false, computeIsRelationship: true, false /*dummy value as we will compute it later*/)
{
}

Expand All @@ -335,7 +335,7 @@ internal ValidatedPartUri(string partUriString)
//This will optimize the code and we will not have to parse the Uri to find out
//if it is a relationship part uri
internal ValidatedPartUri(string partUriString, bool isRelationshipUri)
: this(partUriString, false /*isNormalized*/, false /*computeIsRelationship*/, isRelationshipUri)
: this(partUriString, isNormalized: false, computeIsRelationship: false, isRelationshipUri)
{
}

Expand Down Expand Up @@ -539,8 +539,8 @@ private ValidatedPartUri GetNormalizedPartUri()
return this;
else
return new ValidatedPartUri(_normalizedPartUriString,
true /*isNormalized*/,
false /*computeIsRelationship*/,
isNormalized: true,
computeIsRelationship: false,
IsRelationshipPartUri);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,9 @@ internal class DataSpaceManager
private static readonly string DataSpaceVersionIdentifier = "Microsoft.Container.DataSpaces";

// Version Writer - 1.0, Reader - 1.0, Updater - 1.0
private static readonly VersionPair DataSpaceCurrentWriterVersion = new VersionPair(1 /*major*/, 0 /*minor*/);
private static readonly VersionPair DataSpaceCurrentReaderVersion = new VersionPair(1 /*major*/, 0 /*minor*/);
private static readonly VersionPair DataSpaceCurrentUpdaterVersion = new VersionPair(1 /*major*/, 0 /*minor*/);
private static readonly VersionPair DataSpaceCurrentWriterVersion = new VersionPair(major: 1, minor: 0);
private static readonly VersionPair DataSpaceCurrentReaderVersion = new VersionPair(major: 1, minor: 0);
private static readonly VersionPair DataSpaceCurrentUpdaterVersion = new VersionPair(major: 1, minor: 0);

// The version information we read from the file
private FormatVersion _fileFormatVersion;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -388,7 +388,7 @@ private EffectiveValueEntry GetEffectiveValue(
}
else
{
entry.SetCoercedValue(value, null, true /* skipBaseValueChecks */, entry.IsCoercedWithCurrentValue);
entry.SetCoercedValue(value, null, skipBaseValueChecks: true, entry.IsCoercedWithCurrentValue);
}

_effectiveValues[entryIndex.Index] = entry;
Expand All @@ -414,7 +414,7 @@ public void SetValue(DependencyProperty dp, object value)
PropertyMetadata metadata = SetupPropertyChange(dp);

// Do standard property set
SetValueCommon(dp, value, metadata, false /* coerceWithDeferredReference */, false /* coerceWithCurrentValue */, OperationType.Unknown, false /* isInternal */);
SetValueCommon(dp, value, metadata, coerceWithDeferredReference: false, coerceWithCurrentValue: false, OperationType.Unknown, isInternal: false);
}

/// <summary>
Expand All @@ -440,7 +440,7 @@ public void SetCurrentValue(DependencyProperty dp, object value)
PropertyMetadata metadata = SetupPropertyChange(dp);

// Do standard property set
SetValueCommon(dp, value, metadata, false /* coerceWithDeferredReference */, true /* coerceWithCurrentValue */, OperationType.Unknown, false /* isInternal */);
SetValueCommon(dp, value, metadata, coerceWithDeferredReference: false, coerceWithCurrentValue: true, OperationType.Unknown, isInternal: false);
}

/// <summary>
Expand Down Expand Up @@ -482,7 +482,7 @@ internal void SetValueInternal(DependencyProperty dp, object value)
PropertyMetadata metadata = SetupPropertyChange(dp);

// Do standard property set
SetValueCommon(dp, value, metadata, false /* coerceWithDeferredReference */, false /* coerceWithCurrentValue */, OperationType.Unknown, true /* isInternal */);
SetValueCommon(dp, value, metadata, coerceWithDeferredReference: false, coerceWithCurrentValue: false, OperationType.Unknown, isInternal: true);
}

/// <summary>
Expand All @@ -502,7 +502,7 @@ internal void SetCurrentValueInternal(DependencyProperty dp, object value)
PropertyMetadata metadata = SetupPropertyChange(dp);

// Do standard property set
SetValueCommon(dp, value, metadata, false /* coerceWithDeferredReference */, true /* coerceWithCurrentValue */, OperationType.Unknown, true /* isInternal */);
SetValueCommon(dp, value, metadata, coerceWithDeferredReference: false, coerceWithCurrentValue: true, OperationType.Unknown, isInternal: true);
}

/// <summary>
Expand All @@ -514,7 +514,7 @@ internal void SetDeferredValue(DependencyProperty dp, DeferredReference deferred
PropertyMetadata metadata = SetupPropertyChange(dp);

// Do standard property set
SetValueCommon(dp, deferredReference, metadata, true /* coerceWithDeferredReference */, false /* coerceWithCurrentValue */, OperationType.Unknown, false /* isInternal */);
SetValueCommon(dp, deferredReference, metadata, coerceWithDeferredReference: true, coerceWithCurrentValue: false, OperationType.Unknown, isInternal: false);
}

/// <summary>
Expand All @@ -526,7 +526,7 @@ internal void SetCurrentDeferredValue(DependencyProperty dp, DeferredReference d
PropertyMetadata metadata = SetupPropertyChange(dp);

// Do standard property set
SetValueCommon(dp, deferredReference, metadata, true /* coerceWithDeferredReference */, true /* coerceWithCurrentValue */, OperationType.Unknown, false /* isInternal */);
SetValueCommon(dp, deferredReference, metadata, coerceWithDeferredReference: true, coerceWithCurrentValue: true, OperationType.Unknown, isInternal: false);
}

/// <summary>
Expand All @@ -538,7 +538,7 @@ internal void SetMutableDefaultValue(DependencyProperty dp, object value)
PropertyMetadata metadata = SetupPropertyChange(dp);

// Do standard property set
SetValueCommon(dp, value, metadata, false /* coerceWithDeferredReference */, false /* coerceWithCurrentValue */, OperationType.ChangeMutableDefaultValue, false /* isInternal */);
SetValueCommon(dp, value, metadata, coerceWithDeferredReference: false, coerceWithCurrentValue: false, OperationType.ChangeMutableDefaultValue, isInternal: false);
}

/// <summary>
Expand Down Expand Up @@ -568,7 +568,7 @@ public void SetValue(DependencyPropertyKey key, object value)
PropertyMetadata metadata = SetupPropertyChange(key, out dp);

// Do standard property set
SetValueCommon(dp, value, metadata, false /* coerceWithDeferredReference */, false /* coerceWithCurrentValue */, OperationType.Unknown, false /* isInternal */);
SetValueCommon(dp, value, metadata, coerceWithDeferredReference: false, coerceWithCurrentValue: false, OperationType.Unknown, isInternal: false);
}

/// <summary>
Expand Down Expand Up @@ -998,8 +998,8 @@ private void ClearValueCommon(EntryIndex entryIndex, DependencyProperty dp, Prop
metadata,
oldEntry,
ref newEntry,
false /* coerceWithDeferredReference */,
false /* coerceWithCurrentValue */,
coerceWithDeferredReference: false,
coerceWithCurrentValue: false,
OperationType.Unknown);
}

Expand Down Expand Up @@ -1091,8 +1091,8 @@ public void CoerceValue(DependencyProperty dp)
metadata,
new EffectiveValueEntry() /* oldEntry */,
ref newEntry,
false /* coerceWithDeferredReference */,
false /* coerceWithCurrentValue */,
coerceWithDeferredReference: false,
coerceWithCurrentValue: false,
OperationType.Unknown);
}

Expand Down Expand Up @@ -1188,8 +1188,8 @@ internal void InvalidateProperty(DependencyProperty dp, bool preserveCurrentValu
dp.GetMetadata(DependencyObjectType),
new EffectiveValueEntry() /* oldEntry */,
ref newEntry,
false /* coerceWithDeferredReference */,
false /* coerceWithCurrentValue */,
coerceWithDeferredReference: false,
coerceWithCurrentValue: false,
OperationType.Unknown);
}

Expand Down Expand Up @@ -1389,10 +1389,10 @@ internal UpdateResult UpdateEffectiveValue(
ref oldValue,
baseValue,
controlValue,
null /*coerceValueCallback */,
coerceValueCallback: null,
coerceWithDeferredReference,
coerceWithCurrentValue,
false /*skipBaseValueChecks*/);
skipBaseValueChecks: false);

// Make sure that the call out did not cause a change to entryIndex
entryIndex = CheckEntryIndex(entryIndex, targetIndex);
Expand All @@ -1414,11 +1414,11 @@ internal UpdateResult UpdateEffectiveValue(
ref oldEntry,
ref oldValue,
baseValue,
null /* controlValue */,
controlValue: null,
metadata.CoerceValueCallback,
coerceWithDeferredReference,
false /* coerceWithCurrentValue */,
false /*skipBaseValueChecks*/);
coerceWithCurrentValue: false,
skipBaseValueChecks: false);

// Make sure that the call out did not cause a change to entryIndex
entryIndex = CheckEntryIndex(entryIndex, targetIndex);
Expand Down Expand Up @@ -1448,11 +1448,11 @@ internal UpdateResult UpdateEffectiveValue(
ref oldEntry,
ref oldValue,
newEntry.GetFlattenedEntry(RequestFlags.FullyResolved).Value,
null /*controlValue*/,
controlValue: null,
dp.DesignerCoerceValueCallback,
false /*coerceWithDeferredReference*/,
false /*coerceWithCurrentValue*/,
true /*skipBaseValueChecks*/);
coerceWithDeferredReference: false,
coerceWithCurrentValue: false,
skipBaseValueChecks: true);

// Make sure that the call out did not cause a change to entryIndex
entryIndex = CheckEntryIndex(entryIndex, targetIndex);
Expand Down Expand Up @@ -2134,7 +2134,7 @@ public object ReadLocalValue(DependencyProperty dp)
EntryIndex entryIndex = LookupEntry(dp.GlobalIndex);

// Call Forwarded
return ReadLocalValueEntry(entryIndex, dp, false /* allowDeferredReferences */);
return ReadLocalValueEntry(entryIndex, dp, allowDeferredReferences: false);
}

/// <summary>
Expand Down Expand Up @@ -2197,7 +2197,7 @@ public LocalValueEnumerator GetLocalValueEnumerator()
DependencyProperty dp = DependencyProperty.RegisteredPropertyList.List[_effectiveValues[i].PropertyIndex];
if (dp != null)
{
object localValue = ReadLocalValueEntry(new EntryIndex(i), dp, false /* allowDeferredReferences */);
object localValue = ReadLocalValueEntry(new EntryIndex(i), dp, allowDeferredReferences: false);
if (localValue != DependencyProperty.UnsetValue)
{
snapshot[count++] = new LocalValueEntry(dp, localValue);
Expand Down Expand Up @@ -2623,7 +2623,7 @@ internal void OnInheritanceContextChanged(EventArgs args)
DependencyProperty dp = DependencyProperty.RegisteredPropertyList.List[_effectiveValues[i].PropertyIndex];
if (dp != null)
{
object localValue = ReadLocalValueEntry(new EntryIndex(i), dp, true /* allowDeferredReferences */);
object localValue = ReadLocalValueEntry(new EntryIndex(i), dp, allowDeferredReferences: true);
if (localValue != DependencyProperty.UnsetValue)
{
DependencyObject inheritanceChild = localValue as DependencyObject;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,7 @@ private static void ValidateMetadataDefaultValue(
}

ValidateDefaultValueCommon(defaultMetadata.DefaultValue, propertyType,
propertyName, validateValueCallback, /*checkThreadAffinity = */ true);
propertyName, validateValueCallback, checkThreadAffinity: true);
}

// Validate the given default value, used by PropertyMetadata.GetDefaultValue()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ public Freezable Clone()
Freezable clone = CreateInstance();

clone.CloneCore(this);
Debug_VerifyCloneCommon(/* original = */ this, /* clone = */ clone, /* isDeepClone = */ true);
Debug_VerifyCloneCommon(original: this, clone: clone, isDeepClone: true);

return clone;
}
Expand All @@ -93,7 +93,7 @@ public Freezable CloneCurrentValue()
// Freezable implementers who override CloneCurrentValueCore must ensure that
// on creation the copy is not frozen. Debug_VerifyCloneCommon checks for this,
// among other things.
Debug_VerifyCloneCommon(/* original = */ this, /* clone = */ clone, /* isDeepClone = */ true);
Debug_VerifyCloneCommon(original: this, clone: clone, isDeepClone: true);

return clone;
}
Expand All @@ -115,7 +115,7 @@ public Freezable GetAsFrozen()
Freezable clone = CreateInstance();

clone.GetAsFrozenCore(this);
Debug_VerifyCloneCommon(/* original = */ this, /* clone = */ clone, /* isDeepClone = */ false);
Debug_VerifyCloneCommon(original: this, clone: clone, isDeepClone: false);

clone.Freeze();

Expand All @@ -140,7 +140,7 @@ public Freezable GetCurrentValueAsFrozen()
Freezable clone = CreateInstance();

clone.GetCurrentValueAsFrozenCore(this);
Debug_VerifyCloneCommon(/* original = */ this, /* clone = */ clone, /* isDeepClone = */ false);
Debug_VerifyCloneCommon(original: this, clone: clone, isDeepClone: false);

clone.Freeze();

Expand All @@ -154,7 +154,7 @@ public bool CanFreeze
{
get
{
return IsFrozenInternal || FreezeCore(/* isChecking = */ true);
return IsFrozenInternal || FreezeCore(isChecking: true);
}
}

Expand All @@ -173,7 +173,7 @@ public void Freeze()
throw new InvalidOperationException(SR.Freezable_CantFreeze);
}

Freeze(/* isChecking = */ false);
Freeze(isChecking: false);
}

#endregion
Expand Down Expand Up @@ -348,8 +348,8 @@ protected Freezable CreateInstance()
protected virtual void CloneCore(Freezable sourceFreezable)
{
CloneCoreCommon(sourceFreezable,
/* useCurrentValue = */ false,
/* cloneFrozenValues = */ true);
useCurrentValue: false,
cloneFrozenValues: true);
}

/// <summary>
Expand All @@ -370,8 +370,8 @@ protected virtual void CloneCore(Freezable sourceFreezable)
protected virtual void CloneCurrentValueCore(Freezable sourceFreezable)
{
CloneCoreCommon(sourceFreezable,
/* useCurrentValue = */ true,
/* cloneFrozenValues = */ true);
useCurrentValue: true,
cloneFrozenValues: true);
}

/// <summary>
Expand All @@ -396,8 +396,8 @@ protected virtual void CloneCurrentValueCore(Freezable sourceFreezable)
protected virtual void GetAsFrozenCore(Freezable sourceFreezable)
{
CloneCoreCommon(sourceFreezable,
/* useCurrentValue = */ false,
/* cloneFrozenValues = */ false);
useCurrentValue: false,
cloneFrozenValues: false);
}

/// <summary>
Expand All @@ -421,8 +421,8 @@ protected virtual void GetAsFrozenCore(Freezable sourceFreezable)
protected virtual void GetCurrentValueAsFrozenCore(Freezable sourceFreezable)
{
CloneCoreCommon(sourceFreezable,
/* useCurrentValue = */ true,
/* cloneFrozenValues = */ false);
useCurrentValue: true,
cloneFrozenValues: false);
}

/// <summary>
Expand Down Expand Up @@ -926,7 +926,7 @@ private void CloneCoreCommon(Freezable sourceFreezable, bool useCurrentValue, bo
// If the local value has modifiers, ReadLocalValue will return the base
// value, which is what we want. A modified default will return UnsetValue,
// which will be ignored at the call to SetValue
sourceValue = sourceFreezable.ReadLocalValueEntry(entryIndex, dp, true /* allowDeferredReferences */);
sourceValue = sourceFreezable.ReadLocalValueEntry(entryIndex, dp, allowDeferredReferences: true);

// For the useCurrentValue = false case we ignore any UnsetValues.
if (sourceValue == DependencyProperty.UnsetValue)
Expand Down Expand Up @@ -979,7 +979,7 @@ private void CloneCoreCommon(Freezable sourceFreezable, bool useCurrentValue, bo
}

sourceValue = valueAsFreezableClone;
Debug_VerifyCloneCommon(valueAsFreezable, valueAsFreezableClone, /*isDeepClone=*/ true);
Debug_VerifyCloneCommon(valueAsFreezable, valueAsFreezableClone, isDeepClone: true);
}
else // skip cloning frozen values
{
Expand All @@ -1001,7 +1001,7 @@ private void CloneCoreCommon(Freezable sourceFreezable, bool useCurrentValue, bo
}

sourceValue = valueAsFreezableClone;
Debug_VerifyCloneCommon(valueAsFreezable, valueAsFreezableClone, /*isDeepClone=*/ false);
Debug_VerifyCloneCommon(valueAsFreezable, valueAsFreezableClone, isDeepClone: false);
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ internal MarkupObject() { }
/// If the MarkupItem is in a dictionary, one of the properties of the item will have an IsKey set to true.
/// This is the value for the dictionary key.
/// </summary>
public virtual IEnumerable<MarkupProperty> Properties { get { return GetProperties(true /*mapToConstructorArgs*/); } }
public virtual IEnumerable<MarkupProperty> Properties { get { return GetProperties(mapToConstructorArgs: true); } }
internal abstract IEnumerable<MarkupProperty> GetProperties(bool mapToConstructorArgs);

/// <summary>
Expand Down
Loading

0 comments on commit abdef5d

Please # to comment.