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

[Cleanup] Use named arguments in WindowsBase #10215

Merged
Show file tree
Hide file tree
Changes from all commits
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
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 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 @@ -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 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
Loading