Interface/Interface.cs
changeset 148 878904899ff0
parent 138 426cc984fd18
     1.1 --- a/Interface/Interface.cs	Sun Jun 21 14:15:11 2015 +0200
     1.2 +++ b/Interface/Interface.cs	Sat Jun 27 11:22:42 2015 +0200
     1.3 @@ -50,6 +50,50 @@
     1.4              }
     1.5          }
     1.6  
     1.7 +        /// <summary>
     1.8 +        /// Compare two TableLayout object.
     1.9 +        /// </summary>
    1.10 +        /// <returns>Tells whether both layout are identical.</returns>
    1.11 +        public bool IsSameAs(TableLayout aTableLayout)
    1.12 +        {
    1.13 +            //Check rows and columns counts
    1.14 +            if (Columns.Count != aTableLayout.Columns.Count || Rows.Count != aTableLayout.Rows.Count)
    1.15 +            {
    1.16 +                return false;
    1.17 +            }
    1.18 +
    1.19 +            //Compare each columns
    1.20 +            for (int i=0;i<Columns.Count;i++)
    1.21 +            {
    1.22 +                if (Columns[i].SizeType != aTableLayout.Columns[i].SizeType)
    1.23 +                {
    1.24 +                    return false;
    1.25 +                }
    1.26 +
    1.27 +                if (Columns[i].Width != aTableLayout.Columns[i].Width)
    1.28 +                {
    1.29 +                    return false;
    1.30 +                }
    1.31 +            }
    1.32 +
    1.33 +            //Compare each columns
    1.34 +            for (int i = 0; i < Rows.Count; i++)
    1.35 +            {
    1.36 +                if (Rows[i].SizeType != aTableLayout.Rows[i].SizeType)
    1.37 +                {
    1.38 +                    return false;
    1.39 +                }
    1.40 +
    1.41 +                if (Rows[i].Height != aTableLayout.Rows[i].Height)
    1.42 +                {
    1.43 +                    return false;
    1.44 +                }
    1.45 +            }
    1.46 +
    1.47 +            //Both rows and columns have the same content.
    1.48 +            return true;
    1.49 +        }
    1.50 +
    1.51          [DataMember]
    1.52          public List<ColumnStyle> Columns { get; set; }
    1.53