Пример #1
0
            public static string[] GetColumnsNames(EDBTable value)
            {
                string [] output = null;
                Type      type   = typeof(EDBTable);

                if (_ColumnsNames.ContainsKey(value))
                {
                    output = (_ColumnsNames[value] as ColumnsNamesAttribute).Value;
                }
                else
                {
                    //Look for our 'ColumnsNamesAttribute' in the field's custom attributes
                    FieldInfo fi = type.GetField(value.ToString());
                    ColumnsNamesAttribute[] attrs = fi.GetCustomAttributes(typeof(ColumnsNamesAttribute), false) as ColumnsNamesAttribute[];
                    if (attrs.Length > 0)
                    {
                        _ColumnsNames.Add(value, attrs[0]);
                        output = attrs[0].Value;
                    }
                }
                return(output);
            }
Пример #2
0
            public static string GetSqlCreation(EDBTable value)
            {
                string output = null;
                Type   type   = typeof(EDBTable);

                if (_SqlCreation.ContainsKey(value))
                {
                    output = (_SqlCreation[value] as SqlCreationAttribute).Value;
                }
                else
                {
                    //Look for our 'SqlCreationAttribute' in the field's custom attributes
                    FieldInfo fi = type.GetField(value.ToString());
                    SqlCreationAttribute[] attrs = fi.GetCustomAttributes(typeof(SqlCreationAttribute), false) as SqlCreationAttribute[];
                    if (attrs.Length > 0)
                    {
                        _SqlCreation.Add(value, attrs[0]);
                        output = attrs[0].Value;
                    }
                }
                return(output);
            }
Пример #3
0
            public static string GetPrimaryKeyName(EDBTable value)
            {
                string output = null;
                Type   type   = typeof(EDBTable);

                if (_PrimaryKeyNameValues.ContainsKey(value))
                {
                    output = (_PrimaryKeyNameValues[value] as PrimaryKeyNameAttribute).Value;
                }
                else
                {
                    //Look for our 'PrimaryKeyNameAttribute' in the field's custom attributes
                    FieldInfo fi = type.GetField(value.ToString());
                    PrimaryKeyNameAttribute[] attrs = fi.GetCustomAttributes(typeof(PrimaryKeyNameAttribute), false) as PrimaryKeyNameAttribute[];
                    if (attrs.Length > 0)
                    {
                        _PrimaryKeyNameValues.Add(value, attrs[0]);
                        output = attrs[0].Value;
                    }
                }
                return(output);
            }
Пример #4
0
            public static int[] GetTreeViewDecriptiveColumnsPositions(EDBTable value)
            {
                int[] output = null;
                Type  type   = typeof(EDBTable);

                if (_TreeViewDecriptiveColumnsPositions.ContainsKey(value))
                {
                    output = (_TreeViewDecriptiveColumnsPositions[value] as TreeViewDecriptiveColumnsPositionsAttribute).Value;
                }
                else
                {
                    //Look for our 'TreeViewDecriptiveColumnsPositionsAttribute' in the field's custom attributes
                    FieldInfo fi = type.GetField(value.ToString());
                    TreeViewDecriptiveColumnsPositionsAttribute[] attrs = fi.GetCustomAttributes(typeof(TreeViewDecriptiveColumnsPositionsAttribute), false) as TreeViewDecriptiveColumnsPositionsAttribute[];
                    if (attrs.Length > 0)
                    {
                        _TreeViewDecriptiveColumnsPositions.Add(value, attrs[0]);
                        output = attrs[0].Value;
                    }
                }

                return(output);
            }