Example #1
0
 /// <summary>
 /// 判断本区域是否包含另外一个区域
 /// </summary>
 /// <param name="index">指定的区域</param>
 /// <returns>是否包含</returns>
 public bool Contains(CellIndex index)
 {
     if (index != null)
     {
         if (index.RowIndex >= this.RowIndex && index.ColIndex >= this.ColIndex)
         {
             if (index.RowIndex + index.Height <= this.RowIndex + this.Height)
             {
                 if (index.ColIndex + index.Width <= this.ColIndex + this.Width)
                 {
                     return(true);
                 }
             }
         }
     }
     return(false);
 }
Example #2
0
        public int CompareTo(object obj)
        {
            CellIndex index = obj as CellIndex;

            if (index != null)
            {
                if (this.RowIndex < index.RowIndex)
                {
                    return(-1);
                }
                else if (this.RowIndex == index.RowIndex)
                {
                    return(this.ColIndex - index.ColIndex);
                }
                else
                {
                    return(1);
                }
            }
            return(0);
        }