Beispiel #1
0
 public SQLDataFieldInfo(SQLDataFieldAttribute fa, PropertyInfo property, SQLDataClassInfo parentClass)
 {
     Field     = null;
     Property  = property;
     FieldType = Property.PropertyType;
     Init(fa, parentClass);
 }
Beispiel #2
0
 public SQLDataFieldInfo(SQLDataFieldAttribute fa, FieldInfo field, SQLDataClassInfo parentClass)
 {
     Field     = field;
     Property  = null;
     FieldType = Field.FieldType;
     Init(fa, parentClass);
 }
Beispiel #3
0
        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));
                    }
                }
            }
        }
Beispiel #4
0
 private void Dispose(Boolean disposing)
 {
     if (disposing)
     {
         if (ParentInfo != null)
         {
             (ParentInfo as IDisposable).Dispose();
             ParentInfo = null;
         }
         Field = null;
     }
 }
Beispiel #5
0
 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;
 }
Beispiel #6
0
 public SQLDataClassInfo(PropertyInfo property, SQLDataClassInfo parentClass)
 {
     Field       = null;
     Property    = property;
     ParentField = parentClass;
 }
Beispiel #7
0
 public SQLDataClassInfo(FieldInfo field, SQLDataClassInfo parentClass)
 {
     Field       = field;
     Property    = null;
     ParentField = parentClass;
 }