Skip to content

Commit

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

Contributes to dotnet#10018
  • Loading branch information
ThomasGoulet73 committed Dec 30, 2024
1 parent abdef5d commit 9750c83
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -575,9 +575,9 @@ private int Compare(ValidatedPartUri otherPartUri)
//need to use the private constructor to initialize this particular partUri as we need this in the
//IsRelationshipPartUri, that is called from the constructor.
private static readonly Uri _containerRelationshipNormalizedPartUri = new ValidatedPartUri("/_RELS/.RELS",
true /*isnormalized*/,
false /*computeIsRelationship*/,
true /*IsRelationship*/);
isNormalized: true,
computeIsRelationship: false,
isRelationshipPartUri: true);

private static ReadOnlySpan<char> ForwardSlashSeparator => ['/'];

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -306,8 +306,8 @@ internal void WriteToStream(Stream stream)
{
_isolatedStorageStream.Seek(0, SeekOrigin.Begin);
PackagingUtilities.CopyStream(_isolatedStorageStream, stream,
Int64.MaxValue/*bytes to copy*/,
0x80000 /*512K buffer size */);
bytesToCopy: Int64.MaxValue,
bufferSize: 0x80000 /* 512K */);
}
}
else
Expand Down Expand Up @@ -657,8 +657,8 @@ private void SwitchModeIfNecessary()
_isolatedStorageStream.Seek(0, SeekOrigin.Begin);
newMemStreamBlock.Stream.Seek(0, SeekOrigin.Begin);
PackagingUtilities.CopyStream(_isolatedStorageStream, newMemStreamBlock.Stream,
Int64.MaxValue/*bytes to copy*/,
0x80000 /*512K buffer size */);
bytesToCopy: Int64.MaxValue,
bufferSize: 0x80000 /* 512K */);
}

Debug.Assert(newMemStreamBlock.Stream.Length > 0);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ internal bool Verify(X509Certificate2 signer)

// Validate the Reference tags in the SignedInfo as per the
// restrictions imposed by the OPC spec
ValidateReferences(xmlSig.SignedInfo.References, true /*allowPackageSpecificReference*/);
ValidateReferences(xmlSig.SignedInfo.References, allowPackageSpecificReferences: true);

// verify "standard" XmlSignature portions
result = xmlSig.CheckSignature(signer, true);
Expand Down Expand Up @@ -498,8 +498,8 @@ internal static Stream GenerateRelationshipNodeStream(IEnumerable<System.IO.Pack

// generate a valid Relationship tag according to the Opc schema
InternalRelationshipCollection.WriteRelationshipsAsXml(writer, relationships,
true, /* systematically write target mode */
false /* not in streaming production */
alwaysWriteTargetModeAttribute: true,
inStreamingProduction: false
);

// end of Relationships tag
Expand Down Expand Up @@ -901,7 +901,7 @@ private void AddCustomObjectTags(IEnumerable<System.Security.Cryptography.Xml.Da
{
// Validate the Reference tags in the SignedInfo as per the
// restrictions imposed by the OPC spec
ValidateReferences(objectReferences, false /*allowPackageSpecificReference*/);
ValidateReferences(objectReferences, allowPackageSpecificReferences: false);

foreach (Reference reference in objectReferences)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -381,7 +381,7 @@ private void AddListener(INotifyPropertyChanged source, string propertyName, IWe
if (dict == null)
{
// no entry in the hashtable - add a new one
dict = new HybridDictionary(true /* case insensitive */);
dict = new HybridDictionary(caseInsensitive: true);

this[source] = dict;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -807,7 +807,7 @@ internal Stream GetPrimaryInstanceStreamOf( string transformLabel )
targetInstance.transformPrimaryStream =
new DirtyStateTrackingStream (new MemoryStream
(Array.Empty<byte>(),
false /* Not writable */));
writable: false));
}
else
{
Expand Down Expand Up @@ -1353,7 +1353,7 @@ void ReadTransformDefinitions()
// NOTE: Building MemoryStream directly on top of
// instanceData byte array because we want it to be
// NOT resizable and NOT writable.
instanceDataStream = new MemoryStream(instanceData, false /* Not writable */);
instanceDataStream = new MemoryStream(instanceData, writable: false);
}
else
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1126,8 +1126,8 @@ private void
//copy the stream

PackagingUtilities.CopyStream(packageStream, _packageStream,
Int64.MaxValue, /*bytes to copy*/
4096 /*buffer size */);
bytesToCopy: Int64.MaxValue,
bufferSize: 4096);
_package = Package.Open(_packageStream, FileMode.Open, this.FileOpenAccess);
}
else
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1089,7 +1089,7 @@ public void CoerceValue(DependencyProperty dp)
entryIndex,
dp,
metadata,
new EffectiveValueEntry() /* oldEntry */,
oldEntry: new EffectiveValueEntry(),
ref newEntry,
coerceWithDeferredReference: false,
coerceWithCurrentValue: false,
Expand Down Expand Up @@ -1186,7 +1186,7 @@ internal void InvalidateProperty(DependencyProperty dp, bool preserveCurrentValu
LookupEntry(dp.GlobalIndex),
dp,
dp.GetMetadata(DependencyObjectType),
new EffectiveValueEntry() /* oldEntry */,
oldEntry: new EffectiveValueEntry(),
ref newEntry,
coerceWithDeferredReference: false,
coerceWithCurrentValue: false,
Expand Down Expand Up @@ -3049,7 +3049,7 @@ internal EntryIndex LookupEntry(int targetIndex)

if (iHi <= 0)
{
return new EntryIndex(0, false /* Found */);
return new EntryIndex(0, found: false);
}

// Do a binary search to find the value
Expand Down Expand Up @@ -3091,7 +3091,7 @@ internal EntryIndex LookupEntry(int targetIndex)
}
while (iLo < iHi);

return new EntryIndex(iLo, false /* Found */);
return new EntryIndex(iLo, found: false);
}

// insert the given entry at the given index
Expand Down

0 comments on commit 9750c83

Please # to comment.