// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information. namespace System.Reactive { /// /// Represents a type with a single value. This type is often used to denote the successful completion of a void-returning method (C#) or a Sub procedure (Visual Basic). /// #if !NO_SERIALIZABLE [Serializable] #endif public struct Unit : IEquatable { /// /// Determines whether the specified Unit values is equal to the current Unit. Because Unit has a single value, this always returns true. /// /// An object to compare to the current Unit value. /// Because Unit has a single value, this always returns true. public bool Equals(Unit other) { return true; } /// /// Determines whether the specified System.Object is equal to the current Unit. /// /// The System.Object to compare with the current Unit. /// true if the specified System.Object is a Unit value; otherwise, false. public override bool Equals(object obj) { return obj is Unit; } /// /// Returns the hash code for the current Unit value. /// /// A hash code for the current Unit value. public override int GetHashCode() { return 0; } /// /// Returns a string representation of the current Unit value. /// /// String representation of the current Unit value. public override string ToString() { return "()"; } /// /// Determines whether the two specified Unit values are equal. Because Unit has a single value, this always returns true. /// /// The first Unit value to compare. /// The second Unit value to compare. /// Because Unit has a single value, this always returns true. [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA1801:ReviewUnusedParameters", MessageId = "first", Justification = "Parameter required for operator overloading."), System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA1801:ReviewUnusedParameters", MessageId = "second", Justification = "Parameter required for operator overloading.")] public static bool operator ==(Unit first, Unit second) { return true; } /// /// Determines whether the two specified Unit values are not equal. Because Unit has a single value, this always returns false. /// /// The first Unit value to compare. /// The second Unit value to compare. /// Because Unit has a single value, this always returns false. [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA1801:ReviewUnusedParameters", MessageId = "first", Justification = "Parameter required for operator overloading."), System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA1801:ReviewUnusedParameters", MessageId = "second", Justification = "Parameter required for operator overloading.")] public static bool operator !=(Unit first, Unit second) { return false; } static readonly Unit _default = new Unit(); /// /// Gets the single unit value. /// public static Unit Default { get { return _default; } } } }