Пример #1
0
 public static DelegateType AsDelegate<DelegateType>(this MethodBase mb)
     where DelegateType : Delegate
 {
     return _openDelegates.GetOrAdd((mb, typeof(DelegateType)), 
         pair => mb.CompileTo<DelegateType>()) as DelegateType;
 }