Mercurial > repos > IBBoard
changeset 87:90b9a3fe3c18
* Correct licensing comments at top of files
* Add an EqualityChecker class to handle null-safe equality checks
no-open-ticket
author | IBBoard <dev@ibboard.co.uk> |
---|---|
date | Sat, 21 Aug 2010 10:04:52 +0000 |
parents | 0744a1cc03cc |
children | 3200ed24d29e |
files | EqualityChecker.cs IBBoard.csproj Lang/ModifiableTranslationSet.cs Lang/TranslationLanguage.cs Lang/TranslationXmlLoader.cs Limits/ILimit.cs Limits/INumericLimit.cs Limits/IPercentageLimit.cs Logging/Logger.cs |
diffstat | 9 files changed, 33 insertions(+), 7 deletions(-) [+] |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/EqualityChecker.cs Sat Aug 21 10:04:52 2010 +0000 @@ -0,0 +1,25 @@ +// This file (EqualityChecker.cs) is a part of the IBBoard project and is copyright 2010 IBBoard +// +// 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. +using System; +namespace IBBoard +{ + /// <summary> + /// Null-safe equality checker + /// </summary> + public class EqualityChecker + { + public static bool AreEqual(object obj1, object obj2) + { + bool areEqual = false; + + if ((obj1 == null && obj2 == null) || (obj1 != null && obj1.Equals(obj2))) + { + areEqual = true; + } + + return areEqual; + } + } +} +
--- a/IBBoard.csproj Tue Jul 20 19:26:06 2010 +0000 +++ b/IBBoard.csproj Sat Aug 21 10:04:52 2010 +0000 @@ -140,6 +140,7 @@ <Compile Include="Limits\CompositeMaximumLimit.cs" /> <Compile Include="Limits\CompositeMinimumLimit.cs" /> <Compile Include="Lang\ModifiableTranslationSet.cs" /> + <Compile Include="EqualityChecker.cs" /> </ItemGroup> <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" /> <PropertyGroup>
--- a/Lang/ModifiableTranslationSet.cs Tue Jul 20 19:26:06 2010 +0000 +++ b/Lang/ModifiableTranslationSet.cs Sat Aug 21 10:04:52 2010 +0000 @@ -1,6 +1,6 @@ // This file (TranslationSet.cs) is a part of the IBBoard project and is copyright 2010 IBBoard // -// The file and the library/program it is in are licensed and distributed, without warranty, under the GNU Affero GPL license, either version 3 of the License or (at your option) any later version. Please see COPYING for more information and the full license. +// 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. using System; using System.Collections.Generic;
--- a/Lang/TranslationLanguage.cs Tue Jul 20 19:26:06 2010 +0000 +++ b/Lang/TranslationLanguage.cs Sat Aug 21 10:04:52 2010 +0000 @@ -1,6 +1,6 @@ // This file (TranslationLanguage.cs) is a part of the IBBoard project and is copyright 2010 IBBoard // -// The file and the library/program it is in are licensed and distributed, without warranty, under the GNU Affero GPL license, either version 3 of the License or (at your option) any later version. Please see COPYING for more information and the full license. +// 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. using System; using System.Globalization;
--- a/Lang/TranslationXmlLoader.cs Tue Jul 20 19:26:06 2010 +0000 +++ b/Lang/TranslationXmlLoader.cs Sat Aug 21 10:04:52 2010 +0000 @@ -1,6 +1,6 @@ // This file (TranslationXmlLoader.cs) is a part of the IBBoard project and is copyright 2010 IBBoard // -// The file and the library/program it is in are licensed and distributed, without warranty, under the GNU Affero GPL license, either version 3 of the License or (at your option) any later version. Please see COPYING for more information and the full license. +// 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. using System; using System.IO;
--- a/Limits/ILimit.cs Tue Jul 20 19:26:06 2010 +0000 +++ b/Limits/ILimit.cs Sat Aug 21 10:04:52 2010 +0000 @@ -1,6 +1,6 @@ // This file (ILimit.cs) is a part of the IBBoard project and is copyright 2009 IBBoard // -// The file and the library/program it is in are licensed and distributed, without warranty, under the GNU Affero GPL license, either version 3 of the License or (at your option) any later version. Please see COPYING for more information and the full license. +// 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. using System;
--- a/Limits/INumericLimit.cs Tue Jul 20 19:26:06 2010 +0000 +++ b/Limits/INumericLimit.cs Sat Aug 21 10:04:52 2010 +0000 @@ -1,6 +1,6 @@ // This file (INumericLimit.cs) is a part of the IBBoard project and is copyright 2009 IBBoard // -// The file and the library/program it is in are licensed and distributed, without warranty, under the GNU Affero GPL license, either version 3 of the License or (at your option) any later version. Please see COPYING for more information and the full license. +// 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. using System;
--- a/Limits/IPercentageLimit.cs Tue Jul 20 19:26:06 2010 +0000 +++ b/Limits/IPercentageLimit.cs Sat Aug 21 10:04:52 2010 +0000 @@ -1,6 +1,6 @@ // This file (IPercentageLimit.cs) is a part of the IBBoard project and is copyright 2009 IBBoard // -// The file and the library/program it is in are licensed and distributed, without warranty, under the GNU Affero GPL license, either version 3 of the License or (at your option) any later version. Please see COPYING for more information and the full license. +// 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. using System;
--- a/Logging/Logger.cs Tue Jul 20 19:26:06 2010 +0000 +++ b/Logging/Logger.cs Sat Aug 21 10:04:52 2010 +0000 @@ -86,7 +86,7 @@ public void ResetInternalLog() { - logMessages = new List<IBBoard.Logging.LogItem>(); + logMessages = new List<LogItem>(); LogMessageString("Log reset at " + String.Format("{0:yyyy-MM-dd-HHmmss}", DateTime.Now)); }