/// <summary> /// Returns the bool false to indicate that an operand is false and returns true otherwise. /// </summary> /// <since_tizen> 3 </since_tizen> public static bool operator false(BaseHandle handle) { // if the C# object is null, return true if (BaseHandle.ReferenceEquals(handle, null)) { return(true); } return(!handle.HasBody()); }
/// <summary> /// Returns the bool value true to indicate that an operand is true and returns false otherwise. /// </summary> /// <since_tizen> 3 </since_tizen> public static bool operator true(BaseHandle handle) { // if the C# object is null, return false if (BaseHandle.ReferenceEquals(handle, null)) { return(false); } // returns true if the handle has a body, false otherwise return(handle.HasBody()); }
/// <summary> /// Logical ! operator /// </summary> /// <since_tizen> 3 </since_tizen> public static bool operator !(BaseHandle x) { // if the C# object is null, return true if (BaseHandle.ReferenceEquals(x, null)) { return(true); } if (x.HasBody()) { return(false); } return(true); }
/// <summary> /// Logical OR operator for ||.<br /> /// It's possible when doing a || this function (opBitwiseOr) is never called due to short circuiting.<br /> /// </summary> /// <since_tizen> 3 </since_tizen> public static BaseHandle operator |(BaseHandle x, BaseHandle y) { if (!BaseHandle.ReferenceEquals(x, null) || !BaseHandle.ReferenceEquals(y, null)) { if (x.HasBody()) { return(x); } if (y.HasBody()) { return(y); } return(null); } return(null); }
/// <summary> /// Equality operator /// </summary> /// <since_tizen> 3 </since_tizen> public static bool operator ==(BaseHandle x, BaseHandle y) { // if the C# objects are the same return true if (BaseHandle.ReferenceEquals(x, y)) { return(true); } if (!BaseHandle.ReferenceEquals(x, null) && !BaseHandle.ReferenceEquals(y, null)) { // drop into native code to see if both handles point to the same body return(x.IsEqual(y)); } if (BaseHandle.ReferenceEquals(x, null) && !BaseHandle.ReferenceEquals(y, null)) { if (y.HasBody()) { return(false); } else { return(true); } } if (!BaseHandle.ReferenceEquals(x, null) && BaseHandle.ReferenceEquals(y, null)) { if (x.HasBody()) { return(false); } else { return(true); } } return(false); }