Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
2 changes: 1 addition & 1 deletion src/libraries/System.Console/src/System/TermInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ private Database(string term, byte[] data)
_readAs32Bit =
magic == MagicLegacyNumber ? false :
magic == Magic32BitNumber ? true :
throw new InvalidOperationException(SR.Format(SR.IO_TermInfoInvalidMagicNumber, string.Concat("O" + Convert.ToString(magic, 8)))); // magic number was not recognized. Printing the magic number in octal.
throw new InvalidOperationException(SR.Format(SR.IO_TermInfoInvalidMagicNumber, "O" + Convert.ToString(magic, 8))); // magic number was not recognized. Printing the magic number in octal.
_sizeOfInt = (_readAs32Bit) ? 4 : 2;

_nameSectionNumBytes = ReadInt16(data, 2);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -402,7 +402,7 @@ public string Name

// if we reached here, just encode the value
//
return Convert.ToString(value, 16);
return value.ToString("x");
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -876,7 +876,7 @@ public override bool IsNullable {

public override void Dump(StringBuilder bb, SymbolsDictionary symbols, Positions positions) {
LeftChild.Dump(bb, symbols, positions);
bb.Append($"{{{Convert.ToString(min, NumberFormatInfo.InvariantInfo)}, {Convert.ToString(max, NumberFormatInfo.InvariantInfo)}}}");
bb.Append(NumberFormatInfo.InvariantInfo, $"{{{min}, {max}}");
}

}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -127,20 +127,10 @@ private static string ConvertToArabic(double val, int minLength, int groupSize,
}
else
{
str = Convert.ToString(val, CultureInfo.InvariantCulture);
str = val.ToString(CultureInfo.InvariantCulture);
}

if (str.Length >= minLength)
{
return str;
}
else
{
StringBuilder sb = new StringBuilder(minLength);
sb.Append('0', minLength - str.Length);
sb.Append(str);
return sb.ToString();
}
return str.PadLeft(minLength, '0');
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -615,7 +615,7 @@ internal static void SetKeyParameter(SafeKeyHandle safeKeyHandle, CryptGetKeyPar
{
case CryptGetKeyParamQueryType.KP_IV:
if (!Interop.Advapi32.CryptSetKeyParam(safeKeyHandle, (int)keyParam, value, 0))
throw new CryptographicException(SR.CryptSetKeyParam_Failed, Convert.ToString(GetErrorCode()));
throw new CryptographicException(SR.CryptSetKeyParam_Failed, GetErrorCode().ToString());

break;
default:
Expand All @@ -640,7 +640,7 @@ internal static void SetKeyParameter(SafeKeyHandle safeKeyHandle, CryptGetKeyPar
case CryptGetKeyParamQueryType.KP_MODE_BITS:
case CryptGetKeyParamQueryType.KP_EFFECTIVE_KEYLEN:
if (!Interop.Advapi32.CryptSetKeyParam(safeKeyHandle, (int)keyParam, ref value, 0))
throw new CryptographicException(SR.CryptSetKeyParam_Failed, Convert.ToString(GetErrorCode()));
throw new CryptographicException(SR.CryptSetKeyParam_Failed, GetErrorCode().ToString());

break;
default:
Expand Down Expand Up @@ -716,7 +716,7 @@ private static void ValidateCspFlags(CspProviderFlags flags)
CspProviderFlags.UseUserProtectedKey);
if ((flags & keyFlags) != CspProviderFlags.NoFlags)
{
throw new ArgumentException(SR.Format(SR.Arg_EnumIllegalVal, Convert.ToString(flags)), nameof(flags));
throw new ArgumentException(SR.Format(SR.Arg_EnumIllegalVal, flags), nameof(flags));
}
}
}
Expand Down Expand Up @@ -756,7 +756,7 @@ internal static SafeKeyHandle GetKeyPairHelper(
(keyType == CspAlgorithmType.Dss && dwAlgId != CALG_DSS_SIGN))
{
hKey.Dispose();
throw new CryptographicException(SR.Format(SR.Cryptography_CSP_WrongKeySpec, Convert.ToString(keyType)));
throw new CryptographicException(SR.Format(SR.Cryptography_CSP_WrongKeySpec, keyType));
}

return hKey;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1177,15 +1177,15 @@ private void AddDeviceGroupSidClaims(List<Claim> instanceClaims, TokenInformatio
{
claimType = ClaimTypes.WindowsDeviceGroup;
Claim claim = new Claim(claimType, groupSid.Value, ClaimValueTypes.String, _issuerName, _issuerName, this);
claim.Properties.Add(ClaimTypes.WindowsSubAuthority, Convert.ToString(groupSid.IdentifierAuthority, CultureInfo.InvariantCulture)!);
claim.Properties.Add(ClaimTypes.WindowsSubAuthority, groupSid.IdentifierAuthority.ToString());
claim.Properties.Add(claimType, "");
instanceClaims.Add(claim);
}
else if ((group.Attributes & mask) == Interop.SecurityGroups.SE_GROUP_USE_FOR_DENY_ONLY)
{
claimType = ClaimTypes.DenyOnlyWindowsDeviceGroup;
Claim claim = new Claim(claimType, groupSid.Value, ClaimValueTypes.String, _issuerName, _issuerName, this);
claim.Properties.Add(ClaimTypes.WindowsSubAuthority, Convert.ToString(groupSid.IdentifierAuthority, CultureInfo.InvariantCulture)!);
claim.Properties.Add(ClaimTypes.WindowsSubAuthority, groupSid.IdentifierAuthority.ToString());
claim.Properties.Add(claimType, "");
instanceClaims.Add(claim);
}
Expand Down Expand Up @@ -1244,7 +1244,7 @@ private void AddTokenClaims(List<Claim> instanceClaims, TokenInformationClass to

for (int item = 0; item < windowsClaim.ValueCount; item++)
{
Claim c = new Claim(windowsClaim.Name, Convert.ToString(intValues[item], CultureInfo.InvariantCulture), ClaimValueTypes.Integer64, _issuerName, _issuerName, this);
Claim c = new Claim(windowsClaim.Name, intValues[item].ToString(CultureInfo.InvariantCulture), ClaimValueTypes.Integer64, _issuerName, _issuerName, this);
c.Properties.Add(propertyValue, string.Empty);
instanceClaims.Add(c);
}
Expand All @@ -1257,7 +1257,7 @@ private void AddTokenClaims(List<Claim> instanceClaims, TokenInformationClass to

for (int item = 0; item < windowsClaim.ValueCount; item++)
{
Claim c = new Claim(windowsClaim.Name, Convert.ToString((ulong)uintValues[item], CultureInfo.InvariantCulture), ClaimValueTypes.UInteger64, _issuerName, _issuerName, this);
Claim c = new Claim(windowsClaim.Name, ((ulong)uintValues[item]).ToString(CultureInfo.InvariantCulture), ClaimValueTypes.UInteger64, _issuerName, _issuerName, this);
c.Properties.Add(propertyValue, string.Empty);
instanceClaims.Add(c);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -481,7 +481,7 @@ internal void WriteLink(XmlWriter writer, SyndicationLink link, Uri baseUri)
}
if (link.Length != 0 && !link.AttributeExtensions.ContainsKey(s_atom10Length))
{
writer.WriteAttributeString(Atom10Constants.LengthTag, Convert.ToString(link.Length, CultureInfo.InvariantCulture));
writer.WriteAttributeString(Atom10Constants.LengthTag, link.Length.ToString(CultureInfo.InvariantCulture));
}
if (!link.AttributeExtensions.ContainsKey(s_atom10Href))
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1182,7 +1182,7 @@ private void WriteMediaEnclosure(XmlWriter writer, SyndicationLink link, Uri bas
}
if (link.Length != 0 && !link.AttributeExtensions.ContainsKey(s_rss20Length))
{
writer.WriteAttributeString(Rss20Constants.LengthTag, Rss20Constants.Rss20Namespace, Convert.ToString(link.Length, CultureInfo.InvariantCulture));
writer.WriteAttributeString(Rss20Constants.LengthTag, Rss20Constants.Rss20Namespace, link.Length.ToString(CultureInfo.InvariantCulture));
}
writer.WriteEndElement();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -226,8 +226,7 @@ internal EnlistmentTraceIdentifier EnlistmentTraceId
temp = new EnlistmentTraceIdentifier(
Guid.Empty,
new TransactionTraceIdentifier(
InternalTransaction.InstanceIdentifier +
Convert.ToString(Interlocked.Increment(ref InternalTransaction._nextHash), CultureInfo.InvariantCulture),
string.Create(CultureInfo.InvariantCulture, $"{InternalTransaction.InstanceIdentifier}{Interlocked.Increment(ref InternalTransaction._nextHash)}"),
0),
_enlistmentId);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ internal TransactionTraceIdentifier TransactionTraceId
if (!_traceIdentifierInited)
{
TransactionTraceIdentifier temp = new TransactionTraceIdentifier(
InstanceIdentifier + Convert.ToString(_transactionHash, CultureInfo.InvariantCulture),
string.Create(CultureInfo.InvariantCulture, $"{InstanceIdentifier}{_transactionHash}"),
0);
_traceIdentifier = temp;
_traceIdentifierInited = true;
Expand Down