Esempio n. 1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="StreamedValue"/> class, setting the <see cref="Value"/> and <see cref="DataInfo"/> properties.
        /// </summary>
        /// <param name="value">The value.</param>
        /// <param name="streamedValueInfo">A <see cref="StreamedValueInfo"/> describing the value.</param>
        public StreamedValue(object value, StreamedValueInfo streamedValueInfo)
        {
            ArgumentUtility.CheckNotNull("streamedValueInfo", streamedValueInfo);
            ArgumentUtility.CheckType("value", value, streamedValueInfo.DataType);

            Value    = value;
            DataInfo = streamedValueInfo;
        }
Esempio n. 2
0
        /// <summary>
        /// Initializes a new instance of the <see cref="StreamedValue"/> class, setting the <see cref="Value"/> and <see cref="DataInfo"/> properties.
        /// </summary>
        /// <param name="value">The value.</param>
        /// <param name="streamedValueInfo">A <see cref="StreamedValueInfo"/> describing the value.</param>
        public StreamedValue(object value, StreamedValueInfo streamedValueInfo)
        {
            ArgumentUtility.CheckNotNull("streamedValueInfo", streamedValueInfo);
            if (value != null && !streamedValueInfo.DataType.IsInstanceOfType(value))
            {
                throw new ArgumentTypeException("value", streamedValueInfo.DataType, value.GetType());
            }

            Value    = value;
            DataInfo = streamedValueInfo;
        }
Esempio n. 3
0
 /// <summary>
 /// Initializes a new instance of the <see cref="StreamedValue"/> class, setting the <see cref="Value"/> and <see cref="DataInfo"/> properties.
 /// </summary>
 /// <param name="value">The value.</param>
 /// <param name="streamedValueInfo">A <see cref="StreamedValueInfo"/> describing the value.</param>
 public StreamedValue(object value, StreamedValueInfo streamedValueInfo)
 {
     Value    = value;
     DataInfo = streamedValueInfo;
 }