Beispiel #1
0
        /// <summary>
        /// Determines if the two <see cref="Vlad2Net.Json.JsBoolean"/>s are
        /// equal.
        /// </summary>
        /// <param name="a">The first JsBoolean.</param>
        /// <param name="b">The second JsBoolean.</param>
        /// <returns>True if the JsBooleans are equal, otherwise; false.</returns>
        public static bool Equals(JsBoolean a, JsBoolean b)
        {
            object ao = a;
            object bo = b;

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

            return(a.Value == b.Value);
        }
Beispiel #2
0
 /// <summary>
 /// Creates a <see cref="Vlad2Net.Json.JsBoolean"/> representing
 /// the specified <paramref name="value"/>.
 /// </summary>
 /// <param name="value">The value.</param>
 /// <returns>a <see cref="Vlad2Net.Json.JsBoolean"/> representing
 /// the specified <paramref name="value"/></returns>
 public JsBoolean CreateBoolean(bool value)
 {
     return(JsBoolean.Get(value));
 }
Beispiel #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, JsBoolean.Get(item));
 }
 /// <summary>
 /// Adds the specified item to this collection.
 /// </summary>
 /// <param name="item">The item to add.</param>
 public void Add(bool item)
 {
     base.Add(JsBoolean.Get(item));
 }
Beispiel #5
0
 /// <summary>
 /// Returns a indicating whether this instance is equal to the specified
 /// JsBoolean.
 /// </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(JsBoolean other)
 {
     return(other != null && this.Value == other.Value);
 }
Beispiel #6
0
 /// <summary>
 /// Inequality operator.
 /// </summary>
 /// <param name="a">The first JsBoolean.</param>
 /// <param name="b">The second JsBoolean.</param>
 /// <returns>True if the JsBooleans are not equal, otherwise; false.</returns>
 public static bool operator !=(JsBoolean a, JsBoolean b)
 {
     return(!JsBoolean.Equals(a, b));
 }