예제 #1
0
 /// <summary>
 /// Unreflects constructor to its typed and callable representation.
 /// </summary>
 /// <typeparam name="D">A delegate representing signature of constructor.</typeparam>
 /// <param name="ctor">Constructor to unreflect.</param>
 /// <returns>Unreflected constructor.</returns>
 public static Constructor <D> Unreflect <D>(this ConstructorInfo ctor) where D : MulticastDelegate => Constructor <D> .GetOrCreate(ctor);
예제 #2
0
 /// <summary>
 /// Reflects constructor as function.
 /// </summary>
 /// <param name="nonPublic"><see langword="true"/> to reflect non-public constructor.</param>
 /// <typeparam name="A">A structure describing constructor signature.</typeparam>
 /// <returns>Constructor for type <typeparamref name="T"/>; or null, if it doesn't exist.</returns>
 public static Reflection.Constructor <Function <A, T> > GetConstructor <A>(bool nonPublic = false)
     where A : struct
 => Constructor.Get <Function <A, T> >(nonPublic);
예제 #3
0
 /// <summary>
 /// Reflects constructor as function.
 /// </summary>
 /// <param name="nonPublic"><see langword="true"/> to reflect non-public constructor.</param>
 /// <typeparam name="TArgs">A structure describing constructor signature.</typeparam>
 /// <returns>Constructor for type <typeparamref name="T"/>; or null, if it doesn't exist.</returns>
 public static Reflection.Constructor <Function <TArgs, T> >?GetConstructor <TArgs>(bool nonPublic = false)
 where TArgs : struct
 => Constructor.Get <Function <TArgs, T> >(nonPublic);