/// <summary>
 /// Gets the field type.
 /// </summary>
 /// <param name="field">The field, not null.</param>
 /// <returns>The field type.</returns>
 protected internal abstract StaticTypeWrapper GetFieldType(StaticFieldWrapper field);
 protected override StaticTypeWrapper GetFieldType(StaticFieldWrapper field)
 {
     IField fieldHandle = (IField)field.Handle;
     return MakeType(fieldHandle.Type);
 }
 /// <summary>
 /// Gets the attributes of a field.
 /// </summary>
 /// <param name="field">The field, not null.</param>
 /// <returns>The field attributes.</returns>
 protected internal abstract FieldAttributes GetFieldAttributes(StaticFieldWrapper field);
示例#4
0
 /// <summary>
 /// Gets the field type.
 /// </summary>
 /// <param name="field">The field, not null.</param>
 /// <returns>The field type.</returns>
 protected internal abstract StaticTypeWrapper GetFieldType(StaticFieldWrapper field);
        protected override FieldAttributes GetFieldAttributes(StaticFieldWrapper field)
        {
            IField fieldHandle = (IField)field.Handle;

            FieldAttributes flags = 0;
            switch (fieldHandle.GetAccessRights())
            {
                case AccessRights.PUBLIC:
                    flags |= FieldAttributes.Public;
                    break;
                case AccessRights.PRIVATE:
                    flags |= FieldAttributes.Private;
                    break;
                case AccessRights.NONE:
                case AccessRights.INTERNAL:
                    flags |= FieldAttributes.Assembly;
                    break;
                case AccessRights.PROTECTED:
                    flags |= FieldAttributes.Family;
                    break;
                case AccessRights.PROTECTED_AND_INTERNAL:
                    flags |= FieldAttributes.FamANDAssem;
                    break;
                case AccessRights.PROTECTED_OR_INTERNAL:
                    flags |= FieldAttributes.FamORAssem;
                    break;
            }

            ReflectorFlagsUtils.AddFlagIfTrue(ref flags, FieldAttributes.Static, fieldHandle.IsStatic);
            ReflectorFlagsUtils.AddFlagIfTrue(ref flags, FieldAttributes.InitOnly, fieldHandle.IsReadonly && ! fieldHandle.IsConstant);
            ReflectorFlagsUtils.AddFlagIfTrue(ref flags, FieldAttributes.Literal | FieldAttributes.HasDefault, fieldHandle.IsConstant);
            return flags;
        }
示例#6
0
 /// <summary>
 /// Gets the attributes of a field.
 /// </summary>
 /// <param name="field">The field, not null.</param>
 /// <returns>The field attributes.</returns>
 protected internal abstract FieldAttributes GetFieldAttributes(StaticFieldWrapper field);
示例#7
0
        protected internal override StaticTypeWrapper GetFieldType(StaticFieldWrapper field)
        {
            FieldDefinition fieldHandle = (FieldDefinition)field.Handle;

            return(MakeType(fieldHandle.FieldType));
        }
示例#8
0
        protected internal override FieldAttributes GetFieldAttributes(StaticFieldWrapper field)
        {
            FieldDefinition fieldHandle = (FieldDefinition)field.Handle;

            return((FieldAttributes)fieldHandle.Attributes);
        }
 protected internal override StaticTypeWrapper GetFieldType(StaticFieldWrapper field)
 {
     FieldDefinition fieldHandle = (FieldDefinition)field.Handle;
     return MakeType(fieldHandle.FieldType);
 }
 protected internal override FieldAttributes GetFieldAttributes(StaticFieldWrapper field)
 {
     FieldDefinition fieldHandle = (FieldDefinition)field.Handle;
     return (FieldAttributes)fieldHandle.Attributes;
 }