Exemple #1
0
 /// <summary> <!-- {{{1 --> Throw exception when specified different cell index.
 /// </summary>
 /// <param name="self"></param>
 /// <param name="tgt"></param>
 public static void AssertWhenIndexNotEquals(this SudokuCellIndex self, SudokuCellIndex tgt)
 {
     if (!self.IsEquals(tgt))
     {
         var msg = string.Format("Different cell index: {0} != {1}", self.ToStr(), tgt.ToStr());
         throw new InvalidEnumArgumentException(msg);
     }
 }
Exemple #2
0
 /// <summary> <!-- {{{1 --> Throw exception when specified index is invalid.
 /// </summary>
 /// <param name="self"></param>
 public static void AssertWhenInvalid(this SudokuCellIndex self)
 {
     if (self.IsInvalid())
     {
         var msg = string.Format("Invalid cell index: {0}", self.ToStr());
         throw new ArgumentOutOfRangeException(msg);
     }
 }