Exemplo n.º 1
0
 /// <summary>
 /// Initializes a new instance of the UInt16Value class by deep copying the supplied UInt16Value class.
 /// </summary>
 /// <param name="source">The source UInt16Value class.</param>
 public UInt16Value(UInt16Value source)
     : base(source)
 {
     if (source == null)
     {
         throw new ArgumentNullException(nameof(source));
     }
 }
Exemplo n.º 2
0
        /// <summary>
        /// Returns the UInt16 representation of a UInt16Value object.
        /// </summary>
        /// <param name="xmlAttribute">
        /// A UInt16Value object to retrieve a UInt16 representation.
        /// </param>
        /// <returns>A UInt16 value that represents a UInt16Value object.</returns>
        public static ushort ToUInt16(UInt16Value xmlAttribute)
        {
            if (xmlAttribute == null)
            {
                throw new InvalidOperationException(ExceptionMessages.ImplicitConversionExceptionOnNull);
            }

            return(xmlAttribute.Value);
        }
Exemplo n.º 3
0
        /// <summary>
        /// Returns the <see cref="ushort"/> representation of a <see cref="UInt16Value"/> object.
        /// </summary>
        /// <param name="value">
        /// A <see cref="UInt16Value"/> object to retrieve a <see cref="ushort"/> representation.
        /// </param>
        /// <returns>A <see cref="ushort"/> value that represents a <see cref="UInt16Value"/> object.</returns>
        public static ushort ToUInt16(UInt16Value value)
        {
            if (value is null)
            {
                throw new InvalidOperationException(ExceptionMessages.ImplicitConversionExceptionOnNull);
            }

            return(value.Value);
        }
Exemplo n.º 4
0
 /// <summary>
 /// Initializes a new instance of the UInt16Value class by deep copying the supplied UInt16Value class.
 /// </summary>
 /// <param name="source">The source UInt16Value class.</param>
 public UInt16Value(UInt16Value source)
     : base(source)
 {
 }