Example #1
0
        /// <summary>  Creates a string in the form of DeclaringType.MethodName()  </summary>
        /// <returns>
        ///     A string equivalent to method.DeclaringType + "." + method.Name + "()"; " where 'method' is
        ///     the MethodInfo for <paramref name="delegateToGetInfoFor"/>
        /// </returns>
        public static string GetClassAndMethodName(Delegate delegateToGetInfoFor)
        {
            MethodInfo infoForDelegate = delegateToGetInfoFor.Method;
            ITheType   typeOfDeclarer  = TheType.RepresentedBy(infoForDelegate.DeclaringType);

            return($"{typeOfDeclarer.ReadableName}.{infoForDelegate.Name}");
        }
Example #2
0
 public static string NameOf([CanBeNull] Type typeToGetNameOf) =>
 (typeToGetNameOf != null)  ?  TheType.RepresentedBy(typeToGetNameOf)?.ReadableName  :  "null";