Example #1
0
        public BL Xor(BL b1)
        {
            //return (b1.Not().And(this)).Or((this.Not().And(b1)));
            if (null == b1)
            {
                return new BL()
                       {
                           NullFlavor = MARC.Everest.DataTypes.NullFlavor.NoInformation
                       }
            }
            ;

            // See what operator overloading gives us
            // We could use this:
            // return (this & !b1) | (!this & b1);
            //
            // Instead of :
            return(this.And(b1.Not()).Or(this.Not().And(b1)));
        }
Example #2
0
 public static bool IsValidNonNullFlavor(BL o)
 {
     return(o.NullFlavor == null && o.Value != null);
 }
Example #3
0
        /// <summary>
        /// Test if the Input BL is true
        /// </summary>
        /// /// <param name="a">A BL to test.</param>
        /// <returns>The input BL in a true state, if BL is not null.</returns>
        /// <example>
        /// <code title="Using the True Operator" lang="cs">
        /// <![CDATA[
        /// BL isTrue = true;
        /// if (isTrue)
        /// {
        ///     System.Console.WriteLine("BL is true");
        /// }
        /// else
        /// {
        ///     System.Console.WriteLine("BL is false");
        /// }
        /// ]]>
        /// </code>
        /// </example>
        //[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2225:OperatorOverloadsHaveNamedAlternates"), System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "a")]
        //public static bool operator true(BL a)
        //{
        //    return a != null ? !a.IsNull && a.Value.HasValue && a.Value.Value : false;
        //}

        /// <summary>
        /// Test if the Input BL to false
        /// </summary>
        /// /// <param name="a">A BL to test.</param>
        /// <returns>The input BL in a false state, if BL is not null.</returns>
        /// <example>
        /// <code title="Using the False Operator" lang="cs">
        /// <![CDATA[
        /// BL isTrue = false;
        /// if (isTrue)
        /// {
        ///     System.Console.WriteLine("BL is true");
        /// }
        /// else
        /// {
        ///     System.Console.WriteLine("BL is false");
        /// }
        /// ]]>
        /// </code>
        /// </example>
        //[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2225:OperatorOverloadsHaveNamedAlternates"), System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "a")]
        //public static bool operator false(BL a)
        //{
        //    return a != null ? a.IsNull || a.Value.HasValue && !a.Value.Value : false;
        //}

        #region IEquatable<BL> Members

        /// <summary>
        /// Determine if this BL is equal to another BL
        /// </summary>
        public bool Equals(BL other)
        {
            bool result = base.Equals((PDV <Nullable <Boolean> >)other);

            return(result);
        }