[MethodImplAttribute(MethodImplOptions.InternalCall)]
internal static extern uint GetExceptionCount();
- internal object? DeepCopyStackTrace(object? currentStackTrace)
+ internal static object? DeepCopyStackTrace(object? currentStackTrace)
{
if (currentStackTrace != null)
{
}
}
- internal object? DeepCopyDynamicMethods(object? currentDynamicMethods)
+ internal static object? DeepCopyDynamicMethods(object? currentDynamicMethods)
{
if (currentDynamicMethods != null)
{
// this should help inlining
[DoesNotReturn]
[System.Diagnostics.DebuggerNonUserCode]
- private void ThrowNullThisInDelegateToInstance()
- {
+ private static void ThrowNullThisInDelegateToInstance() =>
throw new ArgumentException(SR.Arg_DlgtNullInst);
- }
[System.Diagnostics.DebuggerNonUserCode]
private void CtorClosed(object target, IntPtr methodPtr)
#endregion
- internal void CheckContext(params Type[]?[]? typess)
+ internal static void CheckContext(params Type[]?[]? typess)
{
if (typess == null)
{
}
}
- internal void CheckContext(params Type?[]? types)
+ internal static void CheckContext(params Type?[]? types)
{
if (types == null)
{
internal int ExceptionHandlerCount => m_exceptions != null ? m_exceptions.Length : 0;
- internal int CalculateNumberOfExceptions(__ExceptionInfo[]? excp)
+ internal static int CalculateNumberOfExceptions(__ExceptionInfo[]? excp)
{
int num = 0;
// this method should return true for any and every ca that requires more work
// than just setting the ca
- private bool IsKnownCA(ConstructorInfo con)
+ private static bool IsKnownCA(ConstructorInfo con)
{
Type? caType = con.DeclaringType;
- if (caType == typeof(System.Runtime.CompilerServices.MethodImplAttribute)) return true;
- else if (caType == typeof(DllImportAttribute)) return true;
- else return false;
+ return caType == typeof(MethodImplAttribute) || caType == typeof(DllImportAttribute);
}
private void ParseCA(ConstructorInfo con)
}
}
- private Type? GetType(string strFormat, Type baseType)
+ private static Type? GetType(string strFormat, Type baseType)
{
// This function takes a string to describe the compound type, such as "[,][]", and a baseType.
if (strFormat == null || strFormat.Equals(string.Empty))
internal void CheckContext(params Type[]?[]? typess)
{
- ContainingAssemblyBuilder.CheckContext(typess);
+ AssemblyBuilder.CheckContext(typess);
}
+
internal void CheckContext(params Type?[]? types)
{
- ContainingAssemblyBuilder.CheckContext(types);
+ AssemblyBuilder.CheckContext(types);
}
[DllImport(JitHelpers.QCall, CharSet = CharSet.Unicode)]
m_signature[m_currSig++] = phandle[i];
}
- private byte[] ExpandArray(byte[] inArray)
+ private static byte[] ExpandArray(byte[] inArray)
{
// Expand the signature buffer size
return ExpandArray(inArray, inArray.Length * 2);
}
- private byte[] ExpandArray(byte[] inArray, int requiredLength)
+ private static byte[] ExpandArray(byte[] inArray, int requiredLength)
{
// Expand the signature buffer size
}
}
- private bool IsDisallowedByRefType(Type type)
+ private static bool IsDisallowedByRefType(Type type)
{
if (!type.IsByRef)
return false;
{
if ((bindingFlags & BindingFlags.IgnoreCase) != 0)
{
- name = name.ToLower(CultureInfo.InvariantCulture);
+ name = name.ToLowerInvariant();
ignoreCase = true;
listType = MemberListType.CaseInsensitive;
}
string name, bool prefixLookup)
{
Debug.Assert(memberInfo != null);
- Debug.Assert(name is null || (bindingFlags & BindingFlags.IgnoreCase) == 0 || (name.ToLower(CultureInfo.InvariantCulture).Equals(name)));
+ Debug.Assert(name is null || (bindingFlags & BindingFlags.IgnoreCase) == 0 || (name.ToLowerInvariant().Equals(name)));
// Filter by Public & Private
if (isPublic)
return ret;
}
- private void WrapArgsForInvokeCall(object[] aArgs, int[] aArgsWrapperTypes)
+ private static void WrapArgsForInvokeCall(object[] aArgs, int[] aArgsWrapperTypes)
{
int cArgs = aArgs.Length;
for (int i = 0; i < cArgs; i++)
}
private static OleAutBinder? s_ForwardCallBinder;
- private OleAutBinder ForwardCallBinder => s_ForwardCallBinder ??= new OleAutBinder();
+ private static OleAutBinder ForwardCallBinder => s_ForwardCallBinder ??= new OleAutBinder();
[Flags]
private enum DispatchWrapperType : int
}
}
- internal void Win32Error(int errorCode, string? str)
+ internal static void Win32Error(int errorCode, string? str)
{
switch (errorCode)
{
throw new PlatformNotSupportedException(SR.PlatformNotSupported_CAS); // This api is only meaningful for very specific partial trust/CAS scenarios
}
- private int ExecuteAssembly(Assembly assembly, string?[]? args)
+ private static int ExecuteAssembly(Assembly assembly, string?[]? args)
{
MethodInfo? entry = assembly.EntryPoint;
if (entry == null)
}
/// <summary>Gets the item stored in the <paramref name="i"/>th entry in <paramref name="segment"/>.</summary>
- private T GetItemWhenAvailable(ConcurrentQueueSegment<T> segment, int i)
+ private static T GetItemWhenAvailable(ConcurrentQueueSegment<T> segment, int i)
{
Debug.Assert(segment._preservedForObservation);
/// <summary>
/// Searched for a active (nonstopped) activity with the given name. Returns null if not found.
/// </summary>
- private ActivityInfo? FindActiveActivity(string name, ActivityInfo? startLocation)
+ private static ActivityInfo? FindActiveActivity(string name, ActivityInfo? startLocation)
{
ActivityInfo? activity = startLocation;
while (activity != null)
/// Strip out "Start" or "End" suffix from activity name and add providerName prefix.
/// If 'task' it does not end in Start or Stop and Task is non-zero use that as the name of the activity
/// </summary>
- private string NormalizeActivityName(string providerName, string activityName, int task)
+ private static string NormalizeActivityName(string providerName, string activityName, int task)
{
// We use provider name to distinguish between activities from different providers.
}
#if !ES_BUILD_PN
- private int GetParameterCount(EventMetadata eventData)
+ private static int GetParameterCount(EventMetadata eventData)
{
return eventData.Parameters.Length;
}
- private Type GetDataType(EventMetadata eventData, int parameterId)
+ private static Type GetDataType(EventMetadata eventData, int parameterId)
{
return eventData.Parameters[parameterId].ParameterType;
}
private const bool m_EventSourcePreventRecursion = false;
#else
- private int GetParameterCount(EventMetadata eventData)
+ private static int GetParameterCount(EventMetadata eventData)
{
int paramCount;
if (eventData.Parameters == null)
return paramCount;
}
- private Type GetDataType(EventMetadata eventData, int parameterId)
+ private static Type GetDataType(EventMetadata eventData, int parameterId)
{
Type dataType;
if (eventData.Parameters == null)
channelTab[value] = new ChannelInfo { Name = name, Keywords = kwd, Attribs = channelAttribute };
}
- private EventChannelType EventChannelToChannelType(EventChannel channel)
+ private static EventChannelType EventChannelToChannelType(EventChannel channel)
{
#if !ES_BUILD_STANDALONE
Debug.Assert(channel >= EventChannel.Admin && channel <= EventChannel.Debug);
#endif
return (EventChannelType)((int)channel - (int)EventChannel.Admin + (int)EventChannelType.Admin);
}
- private EventChannelAttribute GetDefaultChannelAttribute(EventChannel channel)
+
+ private static EventChannelAttribute GetDefaultChannelAttribute(EventChannel channel)
{
EventChannelAttribute attrib = new EventChannelAttribute();
attrib.EventChannelType = EventChannelToChannelType(channel);
}
finally
{
- this.WriteCleanup(pins, pinCount);
+ WriteCleanup(pins, pinCount);
}
}
#endif // FEATURE_MANAGED_ETW
#if FEATURE_MANAGED_ETW
finally
{
- this.WriteCleanup(pins, pinCount);
+ WriteCleanup(pins, pinCount);
}
}
#endif // FEATURE_MANAGED_ETW
System.Runtime.ConstrainedExecution.Cer.Success)]
#endif
[NonEvent]
- private unsafe void WriteCleanup(GCHandle* pPins, int cPins)
+ private static unsafe void WriteCleanup(GCHandle* pPins, int cPins)
{
DataCollector.ThreadInstance.Disable();
}
}
- internal int IndexOfOrdinal(string source, string value, int startIndex, int count, bool ignoreCase)
+ internal static int IndexOfOrdinal(string source, string value, int startIndex, int count, bool ignoreCase)
{
if (!ignoreCase)
{
return LastIndexOfCore(source, value, startIndex, count, options);
}
- internal int LastIndexOfOrdinal(string source, string value, int startIndex, int count, bool ignoreCase)
+ internal static int LastIndexOfOrdinal(string source, string value, int startIndex, int count, bool ignoreCase)
{
if (GlobalizationMode.Invariant)
{
return LocaleData.GetConsoleUICulture(cultureName);
}
- internal bool IsFramework => false;
-
internal bool IsWin32Installed => false;
internal bool IsReplacementCulture => false;
return GetLocaleInfo(cultureName, LocaleStringData.ConsoleFallbackName);
}
- internal bool IsFramework => false;
-
internal bool IsWin32Installed => true;
internal bool IsReplacementCulture
{
get
{
- CultureTypes types = 0;
+ CultureTypes types = _cultureData.IsNeutralCulture ?
+ CultureTypes.NeutralCultures :
+ CultureTypes.SpecificCultures;
- if (_cultureData.IsNeutralCulture)
+ if (_cultureData.IsWin32Installed)
{
- types |= CultureTypes.NeutralCultures;
+ types |= CultureTypes.InstalledWin32Cultures;
}
- else
+
+ if (_cultureData.IsSupplementalCustomCulture)
{
- types |= CultureTypes.SpecificCultures;
+ types |= CultureTypes.UserCustomCulture;
}
- types |= _cultureData.IsWin32Installed ? CultureTypes.InstalledWin32Cultures : 0;
-
- // Disable warning 618: System.Globalization.CultureTypes.FrameworkCultures' is obsolete
-#pragma warning disable 618
- types |= _cultureData.IsFramework ? CultureTypes.FrameworkCultures : 0;
-#pragma warning restore 618
-
- types |= _cultureData.IsSupplementalCustomCulture ? CultureTypes.UserCustomCulture : 0;
- types |= _cultureData.IsReplacementCulture ? CultureTypes.ReplacementCultures | CultureTypes.UserCustomCulture : 0;
+ if (_cultureData.IsReplacementCulture)
+ {
+ types |= CultureTypes.ReplacementCultures;
+ }
return types;
}
// ---- PAL layer ends here ----
// -----------------------------
- private bool NeedsTurkishCasing(string localeName)
+ private static bool NeedsTurkishCasing(string localeName)
{
Debug.Assert(localeName != null);
/// <summary>Stores intermediary parsing state for the standard formats.</summary>
private ref struct TimeSpanRawInfo
{
- internal TimeSpanFormat.FormatLiterals PositiveInvariant => TimeSpanFormat.PositiveInvariantFormatLiterals;
- internal TimeSpanFormat.FormatLiterals NegativeInvariant => TimeSpanFormat.NegativeInvariantFormatLiterals;
-
internal TimeSpanFormat.FormatLiterals PositiveLocalized
{
get
if (inv)
{
- if (raw.FullMatch(raw.PositiveInvariant))
+ if (raw.FullMatch(TimeSpanFormat.PositiveInvariantFormatLiterals))
{
match = true;
positive = true;
}
- if (!match && raw.FullMatch(raw.NegativeInvariant))
+ if (!match && raw.FullMatch(TimeSpanFormat.NegativeInvariantFormatLiterals))
{
match = true;
positive = false;
if (inv)
{
- if (raw.FullHMSFMatch(raw.PositiveInvariant))
+ if (raw.FullHMSFMatch(TimeSpanFormat.PositiveInvariantFormatLiterals))
{
positive = true;
match = TryTimeToTicks(positive, zero, raw._numbers0, raw._numbers1, raw._numbers2, raw._numbers3, out ticks);
overflow = overflow || !match;
}
- if (!match && raw.FullDHMSMatch(raw.PositiveInvariant))
+ if (!match && raw.FullDHMSMatch(TimeSpanFormat.PositiveInvariantFormatLiterals))
{
positive = true;
match = TryTimeToTicks(positive, raw._numbers0, raw._numbers1, raw._numbers2, raw._numbers3, zero, out ticks);
overflow = overflow || !match;
}
- if (!match && raw.FullAppCompatMatch(raw.PositiveInvariant))
+ if (!match && raw.FullAppCompatMatch(TimeSpanFormat.PositiveInvariantFormatLiterals))
{
positive = true;
match = TryTimeToTicks(positive, raw._numbers0, raw._numbers1, raw._numbers2, zero, raw._numbers3, out ticks);
overflow = overflow || !match;
}
- if (!match && raw.FullHMSFMatch(raw.NegativeInvariant))
+ if (!match && raw.FullHMSFMatch(TimeSpanFormat.NegativeInvariantFormatLiterals))
{
positive = false;
match = TryTimeToTicks(positive, zero, raw._numbers0, raw._numbers1, raw._numbers2, raw._numbers3, out ticks);
overflow = overflow || !match;
}
- if (!match && raw.FullDHMSMatch(raw.NegativeInvariant))
+ if (!match && raw.FullDHMSMatch(TimeSpanFormat.NegativeInvariantFormatLiterals))
{
positive = false;
match = TryTimeToTicks(positive, raw._numbers0, raw._numbers1, raw._numbers2, raw._numbers3, zero, out ticks);
overflow = overflow || !match;
}
- if (!match && raw.FullAppCompatMatch(raw.NegativeInvariant))
+ if (!match && raw.FullAppCompatMatch(TimeSpanFormat.NegativeInvariantFormatLiterals))
{
positive = false;
match = TryTimeToTicks(positive, raw._numbers0, raw._numbers1, raw._numbers2, zero, raw._numbers3, out ticks);
if (inv)
{
- if (raw.FullHMSMatch(raw.PositiveInvariant))
+ if (raw.FullHMSMatch(TimeSpanFormat.PositiveInvariantFormatLiterals))
{
positive = true;
match = TryTimeToTicks(positive, zero, raw._numbers0, raw._numbers1, raw._numbers2, zero, out ticks);
overflow = overflow || !match;
}
- if (!match && raw.FullDHMMatch(raw.PositiveInvariant))
+ if (!match && raw.FullDHMMatch(TimeSpanFormat.PositiveInvariantFormatLiterals))
{
positive = true;
match = TryTimeToTicks(positive, raw._numbers0, raw._numbers1, raw._numbers2, zero, zero, out ticks);
overflow = overflow || !match;
}
- if (!match && raw.PartialAppCompatMatch(raw.PositiveInvariant))
+ if (!match && raw.PartialAppCompatMatch(TimeSpanFormat.PositiveInvariantFormatLiterals))
{
positive = true;
match = TryTimeToTicks(positive, zero, raw._numbers0, raw._numbers1, zero, raw._numbers2, out ticks);
overflow = overflow || !match;
}
- if (!match && raw.FullHMSMatch(raw.NegativeInvariant))
+ if (!match && raw.FullHMSMatch(TimeSpanFormat.NegativeInvariantFormatLiterals))
{
positive = false;
match = TryTimeToTicks(positive, zero, raw._numbers0, raw._numbers1, raw._numbers2, zero, out ticks);
overflow = overflow || !match;
}
- if (!match && raw.FullDHMMatch(raw.NegativeInvariant))
+ if (!match && raw.FullDHMMatch(TimeSpanFormat.NegativeInvariantFormatLiterals))
{
positive = false;
match = TryTimeToTicks(positive, raw._numbers0, raw._numbers1, raw._numbers2, zero, zero, out ticks);
overflow = overflow || !match;
}
- if (!match && raw.PartialAppCompatMatch(raw.NegativeInvariant))
+ if (!match && raw.PartialAppCompatMatch(TimeSpanFormat.NegativeInvariantFormatLiterals))
{
positive = false;
match = TryTimeToTicks(positive, zero, raw._numbers0, raw._numbers1, zero, raw._numbers2, out ticks);
if (inv)
{
- if (raw.FullHMMatch(raw.PositiveInvariant))
+ if (raw.FullHMMatch(TimeSpanFormat.PositiveInvariantFormatLiterals))
{
match = true;
positive = true;
}
- if (!match && raw.FullHMMatch(raw.NegativeInvariant))
+ if (!match && raw.FullHMMatch(TimeSpanFormat.NegativeInvariantFormatLiterals))
{
match = true;
positive = false;
if (inv)
{
- if (raw.FullDMatch(raw.PositiveInvariant))
+ if (raw.FullDMatch(TimeSpanFormat.PositiveInvariantFormatLiterals))
{
match = true;
positive = true;
}
- if (!match && raw.FullDMatch(raw.NegativeInvariant))
+ if (!match && raw.FullDMatch(TimeSpanFormat.NegativeInvariantFormatLiterals))
{
match = true;
positive = false;
Debug.Assert(_mediator.MainAssembly != null);
if (!_mediator.LookedForSatelliteContractVersion)
{
- _mediator.SatelliteContractVersion = _mediator.ObtainSatelliteContractVersion(_mediator.MainAssembly);
+ _mediator.SatelliteContractVersion = ResourceManager.ResourceManagerMediator.ObtainSatelliteContractVersion(_mediator.MainAssembly);
_mediator.LookedForSatelliteContractVersion = true;
}
set => _rm._satelliteContractVersion = value;
}
- internal Version? ObtainSatelliteContractVersion(Assembly a) =>
+ internal static Version? ObtainSatelliteContractVersion(Assembly a) =>
ResourceManager.GetSatelliteContractVersion(a);
internal UltimateResourceFallbackLocation FallbackLoc
return (obj, stream) => typedDelegate((TInstance)obj, stream);
}
- private bool ValidateReaderType(string readerType)
+ private static bool ValidateReaderType(string readerType)
{
return ResourceManager.IsDefaultType(readerType, ResourceManager.ResReaderTypeName);
}
return null;
}
- private Assembly ValidateAssemblyNameWithSimpleName(Assembly assembly, string? requestedSimpleName)
+ private static Assembly ValidateAssemblyNameWithSimpleName(Assembly assembly, string? requestedSimpleName)
{
// Get the name of the loaded assembly
string? loadedSimpleName = null;
return CompareInfo.Invariant.IndexOf(this, value, startIndex, count, GetCaseCompareOfComparisonCulture(comparisonType));
case StringComparison.OrdinalIgnoreCase:
- return CompareInfo.Invariant.IndexOfOrdinal(this, value, startIndex, count, GetCaseCompareOfComparisonCulture(comparisonType) != CompareOptions.None);
+ return CompareInfo.IndexOfOrdinal(this, value, startIndex, count, GetCaseCompareOfComparisonCulture(comparisonType) != CompareOptions.None);
default:
throw new ArgumentException(SR.NotSupported_StringComparison, nameof(comparisonType));
case StringComparison.Ordinal:
case StringComparison.OrdinalIgnoreCase:
- return CompareInfo.Invariant.LastIndexOfOrdinal(this, value, startIndex, count, GetCaseCompareOfComparisonCulture(comparisonType) != CompareOptions.None);
+ return CompareInfo.LastIndexOfOrdinal(this, value, startIndex, count, GetCaseCompareOfComparisonCulture(comparisonType) != CompareOptions.None);
default:
throw new ArgumentException(SR.NotSupported_StringComparison, nameof(comparisonType));
return bFallingBack;
}
- // private helper methods
[DoesNotReturn]
- internal void ThrowLastCharRecursive(int charRecursive)
- {
+ internal static void ThrowLastCharRecursive(int charRecursive) =>
// Throw it, using our complete character
- throw new ArgumentException(
- SR.Format(SR.Argument_RecursiveFallback,
- charRecursive), "chars");
- }
+ throw new ArgumentException(SR.Format(SR.Argument_RecursiveFallback, charRecursive), "chars");
}
}
/// <summary>
/// Resizes a table to a certain length (or larger).
/// </summary>
- private void GrowTable(ref LinkedSlotVolatile[] table, int minLength)
+ private static void GrowTable(ref LinkedSlotVolatile[] table, int minLength)
{
Debug.Assert(table.Length < minLength);