File tree Expand file tree Collapse file tree 1 file changed +30
-0
lines changed Expand file tree Collapse file tree 1 file changed +30
-0
lines changed Original file line number Diff line number Diff line change 1+ // <auto-generated /> 
2+ #pragma warning disable
3+ 
4+ #if ! NET5_0_OR_GREATER 
5+ 
6+ namespace  Polyfills ; 
7+ 
8+ using  System ; 
9+ using  System . Reflection ; 
10+ 
11+ static partial  class  Polyfill 
12+ { 
13+     /// <summary> 
14+     /// Creates a delegate of type T with the specified target from this method. 
15+     /// </summary> 
16+     /// <typeparam name="T">The type of the delegate to create.</typeparam> 
17+     /// <returns>The delegate for this method.</returns> 
18+     //Link: https://learn.microsoft.com/en-us/dotnet/api/System.Reflection.MethodInfo.CreateDelegate#system-reflection-methodinfo-createdelegate-1 
19+     public  static T  CreateDelegate < T > ( this  MethodInfo  method )  where  T  :  Delegate  =>  ( T ) method . CreateDelegate ( typeof ( T ) ) ; 
20+ 
21+     /// <summary> 
22+     /// Creates a delegate of type T with the specified target from this method. 
23+     /// </summary> 
24+     /// <param name="target">The object targeted by the delegate.</param> 
25+     /// <typeparam name="T">The type of the delegate to create.</typeparam> 
26+     /// <returns>The delegate for this method.</returns> 
27+     //Link: https://learn.microsoft.com/en-us/dotnet/api/System.Reflection.MethodInfo.CreateDelegate?#system-reflection-methodinfo-createdelegate-1(system-object) 
28+     public  static T  CreateDelegate < T > ( this  MethodInfo  method ,  object ?  target )  where  T  :  Delegate  =>  ( T ) method . CreateDelegate ( typeof ( T ) ,  target ) ; 
29+ } 
30+ #endif
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments