/// <summary> /// Determines if the two <see cref="NetServ.Net.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); }
/// <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)); }
/// <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)); }
/// <summary> /// Creates a <see cref="NetServ.Net.Json.JsonBoolean"/> representing /// the specified <paramref name="value"/>. /// </summary> /// <param name="value">The value.</param> /// <returns>a <see cref="NetServ.Net.Json.JsonBoolean"/> representing /// the specified <paramref name="value"/></returns> public JsonBoolean CreateBoolean(bool value) { return(JsonBoolean.Get(value)); }
/// <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)); }
/// <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); }