Пример #1
0
        /// <summary>
        /// Creates an independent <see cref="DataBlockInfo"/> instance
        /// base on another one.
        /// </summary>
        /// <param name="other">The object to copy.</param>
        /// <returns>Independent <see cref="DataBlockInfo"/> whose
        /// properties match the submitted instance.</returns>
        /// <exception cref="ArgumentNullException">If <paramref name="other"/>
        /// is a null reference.</exception>
        public static DataBlockInfo FromDataBlock(IDataBlockInfo other)
        {
            if (other == null)
            {
                throw new ArgumentNullException("other");
            }

            return(new DataBlockInfo
            {
                TransferTokenId = other.TransferTokenId,
                BlockNumber = other.BlockNumber,
                BlockLength = other.BlockLength,
                Offset = other.Offset,
                IsLastBlock = other.IsLastBlock
            });
        }
Пример #2
0
    /// <summary>
    /// Creates an independent <see cref="DataBlockInfo"/> instance
    /// base on another one.
    /// </summary>
    /// <param name="other">The object to copy.</param>
    /// <returns>Independent <see cref="DataBlockInfo"/> whose
    /// properties match the submitted instance.</returns>
    /// <exception cref="ArgumentNullException">If <paramref name="other"/>
    /// is a null reference.</exception>
    public static DataBlockInfo FromDataBlock(IDataBlockInfo other)
    {
      if (other == null) throw new ArgumentNullException("other");

      return new DataBlockInfo
               {
                 TransferTokenId = other.TransferTokenId,
                 BlockNumber = other.BlockNumber,
                 BlockLength = other.BlockLength,
                 Offset = other.Offset,
                 IsLastBlock = other.IsLastBlock
               };
    }