コード例 #1
0
        /// <summary>
        /// Gets the <see cref="DateTime"/> equivalent of the <see cref="Timestamp"/>.
        /// </summary>
        /// <param name="block">The <see cref="InterfaceDescriptionBlock"/> used to determine the resolution of the <see cref="Timestamp"/>.</param>
        /// <param name="precisionLoss">True if there was precision loss during the transformation.</param>
        /// <returns>The <see cref="DateTime"/> equivalent of the <see cref="Timestamp"/>.</returns>
        public DateTime GetTimestamp(InterfaceDescriptionBlock block, out bool precisionLoss)
        {
            TimestampTransformer transformer;

            try
            {
                transformer = block.GetTimestampTransformer();
            }
            catch (NotImplementedException ex)
            {
                throw new NotSupportedException(ex.Message, ex);
            }
            precisionLoss = transformer.PrecisionLoss;
            return(transformer.ToDateTime(this.Timestamp));
        }
コード例 #2
0
 /// <summary>
 /// Gets the <see cref="DateTime"/> equivalent of the <see cref="Timestamp"/>.
 /// </summary>
 /// <param name="block">The <see cref="InterfaceDescriptionBlock"/> used to determine the resolution of the <see cref="Timestamp"/>.</param>
 /// <param name="precisionLoss">True if there was precision loss during the transformation.</param>
 /// <returns>The <see cref="DateTime"/> equivalent of the <see cref="Timestamp"/>.</returns>
 public DateTime GetTimestamp(InterfaceDescriptionBlock block, out bool precisionLoss)
 {
     TimestampTransformer transformer;
     try
     {
         transformer = block.GetTimestampTransformer();
     }
     catch (NotImplementedException ex)
     {
         throw new NotSupportedException(ex.Message, ex);
     }
     precisionLoss = transformer.PrecisionLoss;
     return transformer.ToDateTime(this.Timestamp);
 }