コード例 #1
0
        /// <summary>
        /// The get messages.
        /// </summary>
        /// <returns>
        /// The <see cref="List"/>.
        /// </returns>
        public List <string> GetMessages()
        {
            var messages          = new List <string>();
            var groupTransactions = this.GroupTransactions();

            foreach (var transactionGroup in groupTransactions)
            {
                if (transactionGroup[0].Value < 0)
                {
                    continue;
                }

                var messageTrytes = string.Empty;
                foreach (var transaction in transactionGroup)
                {
                    if (!transaction.Fragment.IsEmpty)
                    {
                        messageTrytes += transaction.Fragment.Value;
                    }
                }

                var message = new TryteString(messageTrytes);

                if (!string.IsNullOrEmpty(message.Value))
                {
                    messages.Add(message.ToUtf8String());
                }
            }

            return(messages);
        }
コード例 #2
0
ファイル: Transfer.cs プロジェクト: srikanth1694/tangle-.net
 /// <summary>
 /// Initializes a new instance of the <see cref="Transfer"/> class.
 /// </summary>
 /// <param name="address">Address to send to as string</param>
 /// <param name="tag">Tag to use as string</param>
 /// <param name="message">Message to send. Will be handled as ASCII string</param>
 /// <param name="timestamp">Transfer timestamp</param>
 /// <param name="value">Value to attach to transfer</param>
 public Transfer(string address, string tag, string message, DateTime timestamp, long value = 0)
 {
     this.Address         = new Address(address);
     this.Tag             = new Tag(tag);
     this.Message         = TryteString.FromAsciiString(message);
     this.Timestamp       = Utils.Timestamp.Convert(timestamp);
     this.ValueToTransfer = value;
 }
コード例 #3
0
ファイル: Transfer.cs プロジェクト: srikanth1694/tangle-.net
 public Transfer(Address address, Tag tag, TryteString message, DateTime timestamp, long value = 0)
 {
     this.Address         = address;
     this.Tag             = tag;
     this.Message         = message;
     this.Timestamp       = Utils.Timestamp.Convert(timestamp);
     this.ValueToTransfer = value;
 }
コード例 #4
0
 /// <summary>
 /// The concat.
 /// </summary>
 /// <param name="with">
 /// The with.
 /// </param>
 /// <returns>
 /// The <see cref="TryteString"/>.
 /// </returns>
 public TryteString Concat(TryteString with)
 {
     return(new TryteString(this.Value + with.Value));
 }
コード例 #5
0
 /// <summary>
 /// The from utf 8 string.
 /// </summary>
 /// <param name="input">
 /// The input.
 /// </param>
 /// <returns>
 /// The <see cref="Fragment"/>.
 /// </returns>
 public static new Fragment FromUtf8String(string input)
 {
     return(new Fragment(TryteString.FromUtf8String(input).Value));
 }