Inheritance: Object, ICustomTypeDescriptor, ITablePart
Ejemplo n.º 1
0
 public Index(Table t, DataRow indexData) : this(t)
 {
     isNew = indexData == null;
     oldIndex = new Index(t);
     if (!isNew)
     {
         ParseIndexInfo(indexData);
         (this as ITablePart).Saved();
     }
 }
Ejemplo n.º 2
0
 private void LoadIndexes()
 {
   string[] restrictions = new string[4] { null, owningNode.Database, Name, null };
   DataTable dt = owningNode.GetSchema("Indexes", restrictions);
   foreach (DataRow row in dt.Rows)
   {
     Index i = new Index(this, row);
     Indexes.Add(i);
   }
 }
Ejemplo n.º 3
0
 public Index CreateIndexWithUniqueName(bool primary)
 {
   Index newIndex = new Index(this, null);
   newIndex.IsPrimary = primary;
   string baseName = String.Format("{0}_{1}", primary ? "PK" : "IX",
       Name);
   string name = baseName;
   int uniqueIndex = 0;
   while (KeyExists(name))
     name = String.Format("{0}_{1}", baseName, ++uniqueIndex);
   newIndex.Name = name;
   return newIndex;
 }