Пример #1
0
        public static object GetFieldOrProperty(string typename, string name)
        {
            Type t = ClrFacade.GetType(typename);

            if (t == null)
            {
                throw new ArgumentException(String.Format("Type not found: {0}", typename));
            }
            return(GetFieldOrPropertyType(t, name));
        }
Пример #2
0
        public static string[] GetEnumNames(string enumTypename)
        {
            var t = ClrFacade.GetType(enumTypename);

            if (t == null)
            {
                throw new ArgumentException(String.Format("Type not found: {0}", enumTypename));
            }
            return(GetEnumNames(t));
        }
Пример #3
0
        public static string[] GetSignature(string typeName, string memberName)
        {
            Type type = ClrFacade.GetType(typeName);

            if (type != null)
            {
                return(GetSignature_Type(type, memberName));
            }
            else
            {
                return new string[] {}
            };
        }
Пример #4
0
 /// <summary>
 /// Gets a string helping to identify the COM variant to which an object is converted to an unmanaged data structure, if at all.
 /// </summary>
 /// <param name="obj">An object or type name, from which to call a method</param>
 /// <param name="methodName">the name of a method to call on the object or class</param>
 /// <param name="arguments">The arguments to the method call</param>
 /// <returns>A string such as "VT_ARRAY | VT_BOOL" if the method call returns a bool[]</returns>
 public static string GetReturnedVariantTypename(object obj, string methodName, params object[] arguments)
 {
     if (obj == null)
     {
         throw new ArgumentNullException("obj");
     }
     else if (obj is Type)
     {
         return(GetVariantTypename(ClrFacade.InternalCallStaticMethod((Type)obj, methodName, false, arguments)));
     }
     else if (obj is string)
     {
         return(GetVariantTypename(ClrFacade.InternalCallStaticMethod(ClrFacade.GetType((string)obj), methodName, false, arguments)));
     }
     else
     {
         return(GetVariantTypename(ClrFacade.InternalCallInstanceMethod(obj, methodName, false, arguments)));
     }
 }
Пример #5
0
        public static string[] GetStaticProperties(string typeName, string pattern)
        {
            Type type = ClrFacade.GetType(typeName);

            return(getProperties(type, pattern, BindingFlags.Public | BindingFlags.Static));
        }
Пример #6
0
 /// <summary>
 /// Gets all the non-static public constructors of a class.
 /// </summary>
 /// <param name="typeName">type name</param>
 public static string[] GetConstructors(string typeName)
 {
     return(GetConstructors(ClrFacade.GetType(typeName)));
 }