コード例 #1
0
        public static FieldInfo GetField(this IDotnetExpander expander, Type type, string fieldName)
        {
            string assemblyName, typeName;

            expander.ParseName(type, out assemblyName, out typeName);
            return(expander.GetField(assemblyName, typeName, fieldName));
        }
コード例 #2
0
        public static PropertyInfo[] GetSimpleProperties(this IDotnetExpander expander, string name)
        {
            string assemblyName, typeName, value;

            expander.ParseName(name, out assemblyName, out typeName, out value);
            return(expander.GetSimpleProperties(assemblyName, typeName));
        }
コード例 #3
0
        public static PropertyInfo[] GetSelfProperties(this IDotnetExpander expander, Type type)
        {
            string assemblyName, typeName;

            expander.ParseName(type, out assemblyName, out typeName);
            return(expander.GetSelfProperties(assemblyName, typeName));
        }
コード例 #4
0
        public static PropertyInfo GetProperty(this IDotnetExpander expander, Type type, string propertyName)
        {
            string assemblyName, typeName;

            expander.ParseName(type, out assemblyName, out typeName);
            return(expander.GetProperty(assemblyName, typeName, propertyName));
        }
コード例 #5
0
        public static MethodInfo[] GetMethods(this IDotnetExpander expander, Type type)
        {
            string assemblyName, typeName;

            expander.ParseName(type, out assemblyName, out typeName);
            return(expander.GetMethods(assemblyName, typeName));
        }
コード例 #6
0
        public static T GetTypeAttribute <T>(this IDotnetExpander expander, object value) where T : Attribute
        {
            string assemblyName, typeName, valueName;

            expander.ParseName(value, out assemblyName, out typeName, out valueName);
            return(expander.GetTypeAttribute <T>(assemblyName, typeName));
        }
コード例 #7
0
        public static Attribute[] GetFieldAttributes(this IDotnetExpander expander, object value, string fieldName)
        {
            string assemblyName, typeName, valueName;

            expander.ParseName(value, out assemblyName, out typeName, out valueName);
            return(expander.GetFieldAttributes(assemblyName, typeName, fieldName));
        }
コード例 #8
0
        public static MethodInfo GetMethod(this IDotnetExpander expander, object value, string methodName)
        {
            string assemblyName, typeName, valueName;

            expander.ParseName(value, out assemblyName, out typeName, out valueName);
            return(expander.GetMethod(assemblyName, typeName, methodName));
        }
コード例 #9
0
        public static Type GetType(this IDotnetExpander expander, string name)
        {
            string assemblyName, typeName, value;

            expander.ParseName(name, out assemblyName, out typeName, out value);
            return(expander.GetType(assemblyName, typeName));
        }
コード例 #10
0
        public static FieldInfo[] GetFields(this IDotnetExpander expander, string name)
        {
            string assemblyName, typeName, value;

            expander.ParseName(name, out assemblyName, out typeName, out value);
            return(expander.GetFields(assemblyName, typeName));
        }
コード例 #11
0
        public static Attribute[] GetPropertyAttributes(this IDotnetExpander expander, string name, string propertyName)
        {
            string assemblyName, typeName, value;

            expander.ParseName(name, out assemblyName, out typeName, out value);
            return(expander.GetPropertyAttributes(assemblyName, typeName, propertyName));
        }
コード例 #12
0
        public static T GetPropertyAttribute <T>(this IDotnetExpander expander, Type type, string propertyName) where T : Attribute
        {
            string assemblyName, typeName;

            expander.ParseName(type, out assemblyName, out typeName);
            return(expander.GetPropertyAttribute <T>(assemblyName, typeName, propertyName));
        }
コード例 #13
0
        public static Attribute[] GetMethodAttributes(this IDotnetExpander expander, Type type, string methodName)
        {
            string assemblyName, typeName;

            expander.ParseName(type, out assemblyName, out typeName);
            return(expander.GetMethodAttributes(assemblyName, typeName, methodName));
        }
コード例 #14
0
        public static T GetMethodAttribute <T>(this IDotnetExpander expander, string name, string methodName) where T : Attribute
        {
            string assemblyName, typeName, value;

            expander.ParseName(name, out assemblyName, out typeName, out value);
            return(expander.GetMethodAttribute <T>(assemblyName, typeName, methodName));
        }
コード例 #15
0
        public static object CreateInstance(this IDotnetExpander expander, string name, object[] args = null)
        {
            string assemblyName, typeName, value;

            expander.ParseName(name, out assemblyName, out typeName, out value);
            if (string.IsNullOrWhiteSpace(value))
            {
                return(expander.CreateInstance(assemblyName, typeName, args));
            }
            var type = expander.GetType(assemblyName, typeName);

            return(ValueExtensions.IsPrimitive(type) ? value.As(type) : expander.CreateInstance(assemblyName, typeName, args));
        }
コード例 #16
0
        public static void ParseName(this IDotnetExpander expander, object value, out string assemblyName, out string typeName, out string valueName)
        {
            assemblyName = null;
            typeName     = null;
            valueName    = null;
            if (value == null)
            {
                return;
            }
            var type = value.GetType();

            valueName = value.As <string>();
            expander.ParseName(type, out assemblyName, out typeName);
        }
コード例 #17
0
 public static void ParseName <T>(this IDotnetExpander expander, out string assemblyName, out string typeName)
 {
     expander.ParseName(typeof(T), out assemblyName, out typeName);
 }