示例#1
0
        /// <summary>
        /// Clona el objeto ColumnConstraints en una nueva instancia.
        /// </summary>
        public IndexColumns Clone()
        {
            IndexColumns columns = new IndexColumns(Parent);

            for (int index = 0; index < this.Count; index++)
            {
                columns.Add(this[index].Clone(Parent));
            }
            return(columns);
        }
示例#2
0
 /// <summary>
 /// Compara dos campos y devuelve true si son iguales, caso contrario, devuelve false.
 /// </summary>
 public static Boolean Compare(IndexColumns origin, IndexColumns destination)
 {
     if (destination == null)
     {
         throw new ArgumentNullException("destination");
     }
     if (origin == null)
     {
         throw new ArgumentNullException("origin");
     }
     if (origin.Count != destination.Count)
     {
         return(false);
     }
     for (int j = 0; j < origin.Count; j++)
     {
         IndexColumn item = destination[origin[j].FullName];
         if (item == null)
         {
             return(false);
         }
         else
         if (!IndexColumn.Compare(origin[j], item))
         {
             return(false);
         }
     }
     for (int j = 0; j < destination.Count; j++)
     {
         IndexColumn item = origin[destination[j].FullName];
         if (item == null)
         {
             return(false);
         }
         else
         if (!IndexColumn.Compare(destination[j], item))
         {
             return(false);
         }
     }
     return(true);
 }
示例#3
0
 public static Boolean CompareExceptIsDisabled(Index origin, Index destination)
 {
     if (destination == null)
     {
         throw new ArgumentNullException("destination");
     }
     if (origin == null)
     {
         throw new ArgumentNullException("origin");
     }
     if (origin.AllowPageLocks != destination.AllowPageLocks)
     {
         return(false);
     }
     if (origin.AllowRowLocks != destination.AllowRowLocks)
     {
         return(false);
     }
     if (origin.FillFactor != destination.FillFactor)
     {
         return(false);
     }
     if (origin.IgnoreDupKey != destination.IgnoreDupKey)
     {
         return(false);
     }
     if (origin.IsAutoStatistics != destination.IsAutoStatistics)
     {
         return(false);
     }
     if (origin.IsPadded != destination.IsPadded)
     {
         return(false);
     }
     if (origin.IsPrimaryKey != destination.IsPrimaryKey)
     {
         return(false);
     }
     if (origin.IsUniqueKey != destination.IsUniqueKey)
     {
         return(false);
     }
     if (origin.Type != destination.Type)
     {
         return(false);
     }
     if (origin.SortInTempDb != destination.SortInTempDb)
     {
         return(false);
     }
     if (!origin.FilterDefintion.Equals(destination.FilterDefintion))
     {
         return(false);
     }
     if (!IndexColumns.Compare(origin.Columns, destination.Columns))
     {
         return(false);
     }
     //return true;
     return(CompareFileGroup(origin, destination));
 }
示例#4
0
 public Index(ISchemaBase parent)
     : base(parent, ObjectType.Index)
 {
     FilterDefintion = "";
     Columns         = new IndexColumns(parent);
 }