public SQLDataFieldInfo(SQLDataFieldAttribute fa, PropertyInfo property, SQLDataClassInfo parentClass) { Field = null; Property = property; FieldType = Property.PropertyType; Init(fa, parentClass); }
public SQLDataFieldInfo(SQLDataFieldAttribute fa, FieldInfo field, SQLDataClassInfo parentClass) { Field = field; Property = null; FieldType = Field.FieldType; Init(fa, parentClass); }
internal void GetFields(Type Classe, SQLDataClassInfo ParentClass) { foreach (FieldInfo Field in Classe.GetFields(BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance)) { foreach (SQLDataAttribute sqldata in Field.GetCustomAttributes(typeof(SQLDataAttribute), true)) { if (sqldata.GetType() == typeof(SQLDataFieldAttribute)) { Fields.Add(new SQLDataFieldInfo(sqldata as SQLDataFieldAttribute, Field, ParentClass)); } else if (sqldata.GetType() == typeof(SQLDataClassAttribute)) { GetFields(Field.FieldType, new SQLDataClassInfo(Field, ParentClass)); } } } foreach (PropertyInfo Property in Classe.GetProperties(BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance)) { foreach (SQLDataAttribute sqldata in Property.GetCustomAttributes(typeof(SQLDataAttribute), true)) { if (sqldata.GetType() == typeof(SQLDataFieldAttribute)) { Fields.Add(new SQLDataFieldInfo(sqldata as SQLDataFieldAttribute, Property, ParentClass)); } else if (sqldata.GetType() == typeof(SQLDataClassAttribute)) { GetFields(Property.PropertyType, new SQLDataClassInfo(Property, ParentClass)); } } } }
private void Dispose(Boolean disposing) { if (disposing) { if (ParentInfo != null) { (ParentInfo as IDisposable).Dispose(); ParentInfo = null; } Field = null; } }
internal void Init(SQLDataFieldAttribute fa, SQLDataClassInfo parentClass) { ParentInfo = parentClass; if (string.IsNullOrEmpty(fa.SQLFieldName)) { SQLFieldName = string.Empty; if (Field != null) { SQLFieldName = Field.Name.ToUpper(CultureInfo.CurrentCulture); } if (Property != null) { SQLFieldName = Property.Name.ToUpper(CultureInfo.CurrentCulture); } } else { SQLFieldName = fa.SQLFieldName.ToUpper(CultureInfo.CurrentCulture); } fieldIndex = -1; }
public SQLDataClassInfo(PropertyInfo property, SQLDataClassInfo parentClass) { Field = null; Property = property; ParentField = parentClass; }
public SQLDataClassInfo(FieldInfo field, SQLDataClassInfo parentClass) { Field = field; Property = null; ParentField = parentClass; }