Beispiel #1
0
        /// <summary>
        /// 得到表中索引数据表
        /// </summary>
        /// <param name="Indexes"></param>
        /// <returns></returns>
        private DataTable ConverIndexSchemaCollectionToDataTable(IndexSchemaCollection Indexes)
        {
            DataTable dt = new DataTable();

            dt.Columns.Add("IsPrimayColumns", typeof(bool));
            dt.Columns.Add("Name", typeof(string));
            dt.Columns.Add("IsUnique", typeof(bool));
            dt.Columns.Add("IsClustered", typeof(bool));

            if (Indexes != null)
            {
                foreach (IndexSchema indexSchema in Indexes)
                {
                    DataRow row = dt.NewRow();
                    if (indexSchema.IsPrimaryKey)
                    {
                        row["IsPrimayColumns"] = true;
                    }
                    else
                    {
                        row["IsPrimayColumns"] = false;
                    }
                    row["Name"]        = indexSchema.Name;
                    row["IsUnique"]    = indexSchema.IsUnique;
                    row["IsClustered"] = indexSchema.IsClustered;
                    dt.Rows.Add(row);
                }
            }
            return(dt);
        }
Beispiel #2
0
 public static IndexSchemaCollection Synchronized(IndexSchemaCollection collection)
 {
     if (collection == null)
     {
         throw new ArgumentNullException("collection");
     }
     return(new SyncList(collection));
 }
Beispiel #3
0
 public static IndexSchemaCollection ReadOnly(IndexSchemaCollection collection)
 {
     if (collection == null)
     {
         throw new ArgumentNullException("collection");
     }
     return(new ReadOnlyList(collection));
 }
Beispiel #4
0
 public override void AddRange(IndexSchemaCollection collection)
 {
     lock (this._root)
     {
         this._collection.AddRange(collection);
     }
     return;
 }
Beispiel #5
0
        public virtual void AddRange(IndexSchemaCollection collection)
        {
            int num = 6;

Label_000D:
            switch (num)
            {
            case 0:
                if (collection.Count != 0)
                {
                    num = 1;
                }
                else
                {
                    num = 3;
                }
                goto Label_000D;

            case 1:
                if ((this._count + collection.Count) <= this._array.Length)
                {
                    goto Label_00C9;
                }
                num = 2;
                goto Label_000D;

            case 2:
                this.EnsureCapacity(this._count + collection.Count);
                num = 5;
                goto Label_000D;

            case 3:
                return;

            case 4:
                break;

            case 5:
                goto Label_00C9;

            default:
                if (collection != null)
                {
                    num = 0;
                }
                else
                {
                    num = 4;
                }
                goto Label_000D;
            }
            throw new ArgumentNullException("collection");
Label_00C9:
            this._version++;
            Array.Copy(collection.InnerArray, 0, this._array, this._count, collection.Count);
            this._count += collection.Count;
        }
Beispiel #6
0
 public IndexSchemaCollection(IndexSchemaCollection collection)
 {
     if (collection == null)
     {
         throw new ArgumentNullException("collection");
     }
     this._array = new IndexSchema[collection.Count];
     this.AddRange(collection);
 }
Beispiel #7
0
        public virtual object Clone()
        {
            IndexSchemaCollection schemas;

            goto Label_0003;

Label_0003:
            schemas = new IndexSchemaCollection(this._count);
            Array.Copy(this._array, 0, schemas._array, 0, this._count);
            schemas._count   = this._count;
            schemas._version = this._version;
            return(schemas);
        }
Beispiel #8
0
 public override void Refresh()
 {
     base.Refresh();
     this._primaryKey           = null;
     this._keys                 = null;
     this._indexes              = null;
     this._columns              = null;
     this._nonPrimaryKeyColumns = null;
     this._nonKeyColumns        = null;
     this._foreignKeys          = null;
     this._primaryKeys          = null;
     this._primaryKeyChecked    = false;
     base._extendedProperties   = new ExtendedPropertyCollection(this._defaultExtendedProperties);
 }
Beispiel #9
0
 internal SyncList(IndexSchemaCollection collection) : base(IndexSchemaCollection.Tag.Default)
 {
     this._root       = collection.SyncRoot;
     this._collection = collection;
 }
Beispiel #10
0
 public override void AddRange(IndexSchemaCollection collection)
 {
     throw new NotSupportedException("Read-only collections cannot be modified.");
 }
Beispiel #11
0
 internal ReadOnlyList(IndexSchemaCollection collection) : base(IndexSchemaCollection.Tag.Default)
 {
     this._collection = collection;
 }
Beispiel #12
0
 internal Enumerator(IndexSchemaCollection collection)
 {
     this._collection = collection;
     this._version    = collection._version;
     this._index      = -1;
 }