Exemplo n.º 1
0
        /// <summary>
        /// Determines if the two <see cref="Goldtect.Utilities.Json.JsonBoolean"/>s are
        /// equal.
        /// </summary>
        /// <param name="a">The first JsonBoolean.</param>
        /// <param name="b">The second JsonBoolean.</param>
        /// <returns>True if the JsonBooleans are equal, otherwise; false.</returns>
        public static bool Equals(JsonBoolean a, JsonBoolean b)
        {
            object ao = a;
            object bo = b;

            if (ao == bo)
            {
                return(true);
            }
            if (ao == null || bo == null)
            {
                return(false);
            }

            return(a.Value == b.Value);
        }
Exemplo n.º 2
0
 /// <summary>
 /// Creates a <see cref="Goldtect.Utilities.Json.JsonBoolean"/> representing
 /// the specified <paramref name="value"/>.
 /// </summary>
 /// <param name="value">The value.</param>
 /// <returns>a <see cref="Goldtect.Utilities.Json.JsonBoolean"/> representing
 /// the specified <paramref name="value"/></returns>
 public JsonBoolean CreateBoolean(bool value)
 {
     return(JsonBoolean.Get(value));
 }
Exemplo n.º 3
0
 /// <summary>
 /// Adds the specified key and item to this dictionary.
 /// </summary>
 /// <param name="key">The key of the item</param>
 /// <param name="item">The value of the item.</param>
 public void Add(string key, bool item)
 {
     base.Add(key, JsonBoolean.Get(item));
 }
Exemplo n.º 4
0
 /// <summary>
 /// Inequality operator.
 /// </summary>
 /// <param name="a">The first JsonBoolean.</param>
 /// <param name="b">The second JsonBoolean.</param>
 /// <returns>True if the JsonBooleans are not equal, otherwise; false.</returns>
 public static bool operator !=(JsonBoolean a, JsonBoolean b)
 {
     return(!JsonBoolean.Equals(a, b));
 }
Exemplo n.º 5
0
 /// <summary>
 /// Returns a indicating whether this instance is equal to the specified
 /// JsonBoolean.
 /// </summary>
 /// <param name="other">The value to compare.</param>
 /// <returns>True if the specified instance is equal to this instance, otherwise;
 /// false.</returns>
 public bool Equals(JsonBoolean other)
 {
     return(other != null && this.Value == other.Value);
 }
Exemplo n.º 6
0
 /// <summary>
 /// Adds the specified item to this collection.
 /// </summary>
 /// <param name="item">The item to add.</param>
 public void Add(bool item)
 {
     base.Add(JsonBoolean.Get(item));
 }