annotate EqualityChecker.cs @ 100:fa8378a30ed2

* Add some Stream handling utilities no-open-ticket
author IBBoard <dev@ibboard.co.uk>
date Sun, 06 Mar 2011 14:51:05 +0000
parents 90b9a3fe3c18
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
87
90b9a3fe3c18 * Correct licensing comments at top of files
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
1 // This file (EqualityChecker.cs) is a part of the IBBoard project and is copyright 2010 IBBoard
90b9a3fe3c18 * Correct licensing comments at top of files
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
2 //
90b9a3fe3c18 * Correct licensing comments at top of files
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
3 // The file and the library/program it is in are licensed and distributed, without warranty, under the GNU LGPL, either version 3 of the License or (at your option) any later version. Please see COPYING for more information and the full license.
90b9a3fe3c18 * Correct licensing comments at top of files
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
4 using System;
90b9a3fe3c18 * Correct licensing comments at top of files
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
5 namespace IBBoard
90b9a3fe3c18 * Correct licensing comments at top of files
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
6 {
90b9a3fe3c18 * Correct licensing comments at top of files
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
7 /// <summary>
90b9a3fe3c18 * Correct licensing comments at top of files
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
8 /// Null-safe equality checker
90b9a3fe3c18 * Correct licensing comments at top of files
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
9 /// </summary>
90b9a3fe3c18 * Correct licensing comments at top of files
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
10 public class EqualityChecker
90b9a3fe3c18 * Correct licensing comments at top of files
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
11 {
90b9a3fe3c18 * Correct licensing comments at top of files
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
12 public static bool AreEqual(object obj1, object obj2)
90b9a3fe3c18 * Correct licensing comments at top of files
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
13 {
90b9a3fe3c18 * Correct licensing comments at top of files
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
14 bool areEqual = false;
90b9a3fe3c18 * Correct licensing comments at top of files
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
15
90b9a3fe3c18 * Correct licensing comments at top of files
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
16 if ((obj1 == null && obj2 == null) || (obj1 != null && obj1.Equals(obj2)))
90b9a3fe3c18 * Correct licensing comments at top of files
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
17 {
90b9a3fe3c18 * Correct licensing comments at top of files
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
18 areEqual = true;
90b9a3fe3c18 * Correct licensing comments at top of files
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
19 }
90b9a3fe3c18 * Correct licensing comments at top of files
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
20
90b9a3fe3c18 * Correct licensing comments at top of files
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
21 return areEqual;
90b9a3fe3c18 * Correct licensing comments at top of files
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
22 }
90b9a3fe3c18 * Correct licensing comments at top of files
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
23 }
90b9a3fe3c18 * Correct licensing comments at top of files
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
24 }
90b9a3fe3c18 * Correct licensing comments at top of files
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
25