private FieldInfo[] MapFields(IReflectField[] fields, bool shouldStoreTransientFields
			)
		{
			if (!shouldStoreTransientFields)
			{
				fields = FilterTransientFields(fields);
			}
			FieldInfo[] fieldsMeta = new FieldInfo[fields.Length];
			for (int i = 0; i < fields.Length; ++i)
			{
				IReflectField field = fields[i];
				bool isArray = field.GetFieldType().IsArray();
				IReflectClass fieldClass = isArray ? field.GetFieldType().GetComponentType() : field
					.GetFieldType();
				bool isPrimitive = fieldClass.IsPrimitive();
				// TODO: need to handle NArray, currently it ignores NArray and alway sets NArray flag false.
				fieldsMeta[i] = new FieldInfo(field.GetName(), GetClassMeta(fieldClass), isPrimitive
					, isArray, false);
			}
			return fieldsMeta;
		}
Exemplo n.º 2
0
		public virtual void SetFields(FieldInfo[] fields)
		{
			this._fields = fields;
		}