Beispiel #1
0
 public static string GetFullyQualifiedName(this Type type)
 {
     if (type is null)
     {
         throw new ArgumentNullException(nameof(type));
     }
     return(TypeVisit.GetFullyQualifiedName(type));
 }
Beispiel #2
0
 /// <summary>
 /// Finds a constructor with the matching type parameters.
 /// </summary>
 /// <param name="type">The type being tested.</param>
 /// <param name="constructorParameterTypes">The types of the contractor to find.</param>
 /// <returns>The <see cref="ConstructorInfo"/> is a match is found; otherwise, <c>null</c>.</returns>
 public static ConstructorInfo GetMatchingConstructor(this Type type, Type[] constructorParameterTypes)
 {
     return(TypeVisit.GetMatchingConstructor(type, constructorParameterTypes));
 }
Beispiel #3
0
 /// <summary>
 /// Get default constructor without any parameters.
 /// </summary>
 /// <param name="type"></param>
 /// <returns></returns>
 public static ConstructorInfo GetEmptyConstructor(this Type type)
 {
     return(TypeVisit.GetEmptyConstructor(type));
 }
Beispiel #4
0
 /// <summary>
 /// Determine whether there is a parameterless constructor.
 /// </summary>
 /// <param name="type"></param>
 /// <returns></returns>
 public static bool HasEmptyConstructor(this Type type)
 {
     return(TypeVisit.HasEmptyConstructor(type));
 }
 /// <summary>
 /// Determine whether MethodBase is Visible.
 /// </summary>
 /// <param name="method"></param>
 /// <returns></returns>
 /// <exception cref="ArgumentNullException"></exception>
 public static bool IsVisible(this MethodBase method)
 {
     return(TypeVisit.IsVisible(method));
 }
 /// <summary>
 /// Determine whether MethodInfo is Visible and Virtual.
 /// </summary>
 /// <param name="method"></param>
 /// <returns></returns>
 /// <exception cref="ArgumentNullException"></exception>
 public static bool IsVisibleAndVirtual(this MethodInfo method)
 {
     return(TypeVisit.IsVisibleAndVirtual(method));
 }
 /// <summary>
 /// Get BaseMethod
 /// </summary>
 /// <param name="method"></param>
 /// <returns></returns>
 public static MethodInfo GetBaseMethod(this MethodInfo method)
 {
     return(TypeVisit.GetBaseMethod(method));
 }
 /// <summary>
 /// Get method by signature
 /// </summary>
 /// <param name="type"></param>
 /// <param name="method"></param>
 /// <returns></returns>
 /// <exception cref="ArgumentNullException"></exception>
 public static MethodInfo GetMethodBySignature(this Type type, MethodInfo method)
 {
     return(TypeVisit.GetMethodBySignature(type, method));
 }
 /// <summary>
 /// Get unique fully qualified name for <see cref="MethodInfo"/>.<br />
 /// 获取给定 <see cref="MethodInfo"/> 的完全限定名。
 /// </summary>
 /// <param name="method"></param>
 /// <returns></returns>
 public static string GetFullyQualifiedName(this MethodInfo method)
 {
     return(TypeVisit.GetFullyQualifiedName(method));
 }