@@ -19,13 +19,13 @@ public static async Task ConnectAsync(this TcpClient tcpClient, IPAddress addres
1919 await tcpClient . ConnectAsync ( address , port ) ;
2020 }
2121#endif
22- public static Error ToError ( this Exception ex ) => new ( ex . Message , ex . StackTrace ?? ex . GetBaseException ( ) . StackTrace , GetExceptionType ( ex ) , ex . InnerException ? . ToError ( ) ) ;
22+ internal static Error ToError ( this Exception ex ) => new ( ex . Message , ex . StackTrace ?? ex . GetBaseException ( ) . StackTrace , GetExceptionType ( ex ) , ex . InnerException ? . ToError ( ) ) ;
2323 private static string GetExceptionType ( Exception exception ) => ( exception as RemoteException ) ? . Type ?? exception . GetType ( ) . FullName ;
24- public static bool Enabled ( this ILogger logger ) => logger != null && logger . IsEnabled ( LogLevel . Information ) ;
24+ internal static bool Enabled ( this ILogger logger ) => logger != null && logger . IsEnabled ( LogLevel . Information ) ;
2525 [ Conditional ( "DEBUG" ) ]
26- public static void AssertDisposed ( this SemaphoreSlim semaphore ) => semaphore . AssertFieldNull ( "m_waitHandle" ) ;
26+ internal static void AssertDisposed ( this SemaphoreSlim semaphore ) => semaphore . AssertFieldNull ( "m_waitHandle" ) ;
2727 [ Conditional ( "DEBUG" ) ]
28- public static void AssertDisposed ( this CancellationTokenSource cts )
28+ internal static void AssertDisposed ( this CancellationTokenSource cts )
2929 {
3030#if NET461
3131 cts . AssertFieldNull ( "m_kernelEvent" ) ;
@@ -38,10 +38,10 @@ public static void AssertDisposed(this CancellationTokenSource cts)
3838 [ Conditional ( "DEBUG" ) ]
3939 static void AssertFieldNull ( this object obj , string field ) =>
4040 Debug . Assert ( obj . GetType ( ) . GetField ( field , BindingFlags . Instance | BindingFlags . NonPublic ) . GetValue ( obj ) == null ) ;
41- public static TDelegate MakeGenericDelegate < TDelegate > ( this MethodInfo genericMethod , Type genericArgument ) where TDelegate : Delegate =>
41+ internal static TDelegate MakeGenericDelegate < TDelegate > ( this MethodInfo genericMethod , Type genericArgument ) where TDelegate : Delegate =>
4242 ( TDelegate ) genericMethod . MakeGenericMethod ( genericArgument ) . CreateDelegate ( typeof ( TDelegate ) ) ;
43- public static MethodInfo GetStaticMethod ( this Type type , string name ) => type . GetMethod ( name , BindingFlags . Static | BindingFlags . NonPublic ) ;
44- public static MethodInfo GetInterfaceMethod ( this Type type , string name )
43+ internal static MethodInfo GetStaticMethod ( this Type type , string name ) => type . GetMethod ( name , BindingFlags . Static | BindingFlags . NonPublic ) ;
44+ internal static MethodInfo GetInterfaceMethod ( this Type type , string name )
4545 {
4646 var method = type . GetMethod ( name , InstanceFlags ) ??
4747 type . GetInterfaces ( ) . Select ( t => t . GetMethod ( name , InstanceFlags ) ) . FirstOrDefault ( m => m != null ) ??
@@ -52,15 +52,15 @@ public static MethodInfo GetInterfaceMethod(this Type type, string name)
5252 }
5353 return method ;
5454 }
55- public static IEnumerable < MethodInfo > GetInterfaceMethods ( this Type type ) =>
55+ internal static IEnumerable < MethodInfo > GetInterfaceMethods ( this Type type ) =>
5656 type . GetMethods ( ) . Concat ( type . GetInterfaces ( ) . SelectMany ( i => i . GetMethods ( ) ) ) ;
57- public static object GetDefaultValue ( this ParameterInfo parameter ) => parameter switch
57+ internal static object GetDefaultValue ( this ParameterInfo parameter ) => parameter switch
5858 {
5959 { HasDefaultValue : false } => null ,
6060 { ParameterType : { IsValueType : true } , DefaultValue : null } => Activator . CreateInstance ( parameter . ParameterType ) ,
6161 _ => parameter . DefaultValue
6262 } ;
63- public static ReadOnlyDictionary < TKey , TValue > ToReadOnlyDictionary < TKey , TValue > ( this IDictionary < TKey , TValue > dictionary ) => new ( dictionary ) ;
63+ internal static ReadOnlyDictionary < TKey , TValue > ToReadOnlyDictionary < TKey , TValue > ( this IDictionary < TKey , TValue > dictionary ) => new ( dictionary ) ;
6464 public static void LogException ( this ILogger logger , Exception ex , object tag )
6565 {
6666 var message = $ "{ tag } # { ex } ";
@@ -167,7 +167,7 @@ private static async ValueTask WriteMessageCore(this Stream stream, RecyclableMe
167167 internal static Task WriteBuffer ( this Stream stream , byte [ ] buffer , CancellationToken cancellationToken ) =>
168168 stream . WriteAsync ( buffer , 0 , buffer . Length , cancellationToken ) ;
169169}
170- public static class Validator
170+ internal static class Validator
171171{
172172 public static void Validate ( ServiceHostBuilder serviceHostBuilder )
173173 {
@@ -267,7 +267,7 @@ private static void CheckDerivedStream(MethodInfo method, Type type)
267267 }
268268 }
269269}
270- public readonly struct TimeoutHelper : IDisposable
270+ internal readonly struct TimeoutHelper : IDisposable
271271{
272272 private static readonly Action < object > LinkedTokenCancelDelegate = static s => ( ( CancellationTokenSource ) s ) . Cancel ( ) ;
273273 private readonly PooledCancellationTokenSource _timeoutCancellationSource ;
0 commit comments