IKVM.Reflection.Type.GetField C# (CSharp) Method

GetField() public method

public GetField ( string name ) : IKVM.Reflection.FieldInfo
name string
return IKVM.Reflection.FieldInfo
        public FieldInfo GetField(string name)
        {
            return GetField(name, BindingFlags.Public | BindingFlags.Instance | BindingFlags.Static);
        }

Same methods

Type::GetField ( string name, BindingFlags bindingAttr ) : IKVM.Reflection.FieldInfo

Usage Example

Example #1
0
        internal static FieldInfo GetClassLiteralField(Type type)
        {
            Debug.Assert(type != Types.Void);
            if (classLiteralType == null)
            {
#if STATIC_COMPILER
                classLiteralType = JVM.CoreAssembly.GetType("ikvm.internal.ClassLiteral`1");
#elif !FIRST_PASS
                classLiteralType = typeof([email protected] <>);
#endif
            }
#if !STATIC_COMPILER
            if (!IsTypeBuilder(type))
            {
                return(classLiteralType.MakeGenericType(type).GetField("Value", BindingFlags.Public | BindingFlags.Static));
            }
#endif
            if (classLiteralField == null)
            {
                classLiteralField = classLiteralType.GetField("Value", BindingFlags.Public | BindingFlags.Static);
            }
            return(TypeBuilder.GetField(classLiteralType.MakeGenericType(type), classLiteralField));
        }