File: Unit.cs

package info (click to toggle)
mono 6.14.1%2Bds-2
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 1,289,432 kB
  • sloc: cs: 11,182,461; xml: 2,850,281; ansic: 699,330; cpp: 122,919; perl: 59,361; javascript: 30,841; asm: 21,845; makefile: 19,588; sh: 15,277; python: 4,772; pascal: 925; sql: 859; sed: 16; php: 1
file content (82 lines) | stat: -rw-r--r-- 3,928 bytes parent folder | download | duplicates (11)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information.

namespace System.Reactive
{
    /// <summary>
    /// 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).
    /// </summary>
#if !NO_SERIALIZABLE
    [Serializable]
#endif
    public struct Unit : IEquatable<Unit>
    {
        /// <summary>
        /// Determines whether the specified Unit values is equal to the current Unit. Because Unit has a single value, this always returns true.
        /// </summary>
        /// <param name="other">An object to compare to the current Unit value.</param>
        /// <returns>Because Unit has a single value, this always returns true.</returns>
        public bool Equals(Unit other)
        {
            return true;
        }

        /// <summary>
        /// Determines whether the specified System.Object is equal to the current Unit.
        /// </summary>
        /// <param name="obj">The System.Object to compare with the current Unit.</param>
        /// <returns>true if the specified System.Object is a Unit value; otherwise, false.</returns>
        public override bool Equals(object obj)
        {
            return obj is Unit;
        }

        /// <summary>
        /// Returns the hash code for the current Unit value.
        /// </summary>
        /// <returns>A hash code for the current Unit value.</returns>
        public override int GetHashCode()
        {
            return 0;
        }

        /// <summary>
        /// Returns a string representation of the current Unit value.
        /// </summary>
        /// <returns>String representation of the current Unit value.</returns>
        public override string ToString()
        {
            return "()";
        }

        /// <summary>
        /// Determines whether the two specified Unit values are equal. Because Unit has a single value, this always returns true.
        /// </summary>
        /// <param name="first">The first Unit value to compare.</param>
        /// <param name="second">The second Unit value to compare.</param>
        /// <returns>Because Unit has a single value, this always returns true.</returns>
        [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;
        }

        /// <summary>
        /// Determines whether the two specified Unit values are not equal. Because Unit has a single value, this always returns false.
        /// </summary>
        /// <param name="first">The first Unit value to compare.</param>
        /// <param name="second">The second Unit value to compare.</param>
        /// <returns>Because Unit has a single value, this always returns false.</returns>
        [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();

        /// <summary>
        /// Gets the single unit value.
        /// </summary>
        public static Unit Default { get { return _default; } }
    }
}