Пример #1
0
        public override string ToString()
        {
            var sb = new StringBuilder("ColumnDef(");

            if ((Name != null))
            {
                sb.Append(", Name: ");
                Name.ToString(sb);
            }
            if ((Validation_class != null))
            {
                sb.Append(", Validation_class: ");
                Validation_class.ToString(sb);
            }
            if (__isset.index_type)
            {
                sb.Append(", Index_type: ");
                Index_type.ToString(sb);
            }
            if ((Index_name != null) && __isset.index_name)
            {
                sb.Append(", Index_name: ");
                Index_name.ToString(sb);
            }
            if ((Index_options != null) && __isset.index_options)
            {
                sb.Append(", Index_options: ");
                Index_options.ToString(sb);
            }
            sb.Append(')');
            return(sb.ToString());
        }
Пример #2
0
        public override int GetHashCode()
        {
            int hashcode = 157;

            unchecked {
                if ((Name != null))
                {
                    hashcode = (hashcode * 397) + Name.GetHashCode();
                }
                if ((Validation_class != null))
                {
                    hashcode = (hashcode * 397) + Validation_class.GetHashCode();
                }
                if (__isset.index_type)
                {
                    hashcode = (hashcode * 397) + Index_type.GetHashCode();
                }
                if ((Index_name != null) && __isset.index_name)
                {
                    hashcode = (hashcode * 397) + Index_name.GetHashCode();
                }
                if ((Index_options != null) && __isset.index_options)
                {
                    hashcode = (hashcode * 397) + TCollections.GetHashCode(Index_options);
                }
            }
            return(hashcode);
        }
Пример #3
0
        public Index[] GetItems(Index_type Exclude)
        {
            List <Index> _GetItems = new List <Index>();

            foreach (Index I in _Items)
            {
                if ((I.type & Exclude) != I.type)
                {
                    _GetItems.Add(I);
                }
            }
            return(_GetItems.ToArray());
        }
Пример #4
0
        public int CountIndexes(Index_type Exclude, bool IncludePrimaryKeyIndex)
        {
            int cnt = 0;

            foreach (Index I in _Items)
            {
                if (((I.type & Exclude) != I.type))
                {
                    if (I.is_primary_key)
                    {
                        if (IncludePrimaryKeyIndex)
                        {
                            cnt++;
                        }
                    }
                    else
                    {
                        cnt++;
                    }
                }
            }
            return(cnt);
        }
Пример #5
0
 public int CountIndexes(Index_type Exclude)
 {
     return(CountIndexes(Exclude, true));
 }
Пример #6
0
 private void AddFromRecordSet(SQLiteDataReader rs)
 {
     try
     {
         if (!rs.IsDBNull(0))
         {
             _object_id = rs.GetInt32(0);
         }
         if (!rs.IsDBNull(1))
         {
             _name = rs.GetString(1);
         }
         if (!rs.IsDBNull(2))
         {
             _index_id = rs.GetInt32(2);
         }
         if (!rs.IsDBNull(3))
         {
             byte tmptype = rs.GetByte(3);
             _type = (Index_type)tmptype;
             //switch (tmptype)
             //{
             //    case 0:
             //        _type = Index_type.Heap;
             //        break;
             //    case 1:
             //        _type = Index_type.Clustered;
             //        break;
             //    case 2:
             //        _type = Index_type.Nonclustered;
             //        break;
             //    case 3:
             //        _type = Index_type.XML;
             //        break;
             //    default:
             //        break;
             //}
         }
         if (!rs.IsDBNull(4))
         {
             _type_desc = rs.GetString(4);
         }
         if (!rs.IsDBNull(5))
         {
             _is_unique = rs.GetBoolean(5);
         }
         if (!rs.IsDBNull(6))
         {
             _data_space_id = rs.GetInt32(6);
         }
         if (!rs.IsDBNull(7))
         {
             _ignore_dup_key = rs.GetBoolean(7);
         }
         if (!rs.IsDBNull(8))
         {
             _is_primary_key = rs.GetBoolean(8);
         }
         if (!rs.IsDBNull(9))
         {
             _is_unique_constraint = rs.GetBoolean(9);
         }
         if (!rs.IsDBNull(10))
         {
             _fill_factor = rs.GetByte(10);
         }
         if (!rs.IsDBNull(11))
         {
             _is_padded = rs.GetBoolean(11);
         }
         if (!rs.IsDBNull(12))
         {
             _is_disabled = rs.GetBoolean(12);
         }
         if (!rs.IsDBNull(13))
         {
             _is_hypothetical = rs.GetBoolean(13);
         }
         if (!rs.IsDBNull(14))
         {
             _allow_row_locks = rs.GetBoolean(14);
         }
         if (!rs.IsDBNull(15))
         {
             _allow_page_locks = rs.GetBoolean(15);
         }
     }
     catch (Exception)
     {
         throw;
     }
 }