Example #1
0
        /// <summary>
        /// Returns the internal Boolean representation of a TrueFalseValue object.
        /// </summary>
        /// <param name="xmlAttribute">A TrueFalseValue object to retrieve an internal Boolean representation.</param>
        /// <returns>A Boolean value that represents a TrueFalseValue object.</returns>
        public static bool ToBoolean(TrueFalseValue xmlAttribute)
        {
            if (xmlAttribute == null)
            {
                throw new InvalidOperationException(ExceptionMessages.ImplicitConversionExceptionOnNull);
            }

            return(xmlAttribute.Value);
        }
Example #2
0
        /// <summary>
        /// Returns the internal <see cref="bool"/> representation of a <see cref="TrueFalseValue"/> object.
        /// </summary>
        /// <param name="value">A <see cref="TrueFalseValue"/> object to retrieve an internal <see cref="bool"/> representation.</param>
        /// <returns>A <see cref="bool"/> value that represents a <see cref="TrueFalseValue"/> object.</returns>
        public static bool ToBoolean(TrueFalseValue value)
        {
            if (value is null)
            {
                throw new InvalidOperationException(ExceptionMessages.ImplicitConversionExceptionOnNull);
            }

            return(value.Value);
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="TrueFalseValue"/> class using the supplied TrueFalseValue class.
        /// </summary>
        /// <param name="source">The source <see cref="TrueFalseValue"/> class.</param>
        public TrueFalseValue(TrueFalseValue source)
            : base(source)
        {
            if (source == null)
            {
                throw new ArgumentNullException(nameof(source));
            }

            Initialize();
            _impl.InnerText = source.InnerText;
        }
Example #4
0
 /// <summary>
 /// Initializes a new instance of the <see cref="TrueFalseValue"/> class using the supplied TrueFalseValue class.
 /// </summary>
 /// <param name="source">The source <see cref="TrueFalseValue"/> class.</param>
 public TrueFalseValue(TrueFalseValue source)
     : base(source)
 {
 }