Exemple #1
0
        public void AddTransaction(Transaction tx)
        {
            if (this.transactions.Count == 5)
            {
                throw new WireCardException("Can't add more than 5 transactions to a single function!");
            }

            if (this.transactions.Count > 0)
            {
                var t = this.transactions.First().GetType();

                if (tx.GetType() != t)
                {
                    throw new WireCardException("A single function can only contain transactions of the same type!");
                }
            }

            if (!IsTransactionAcceptable(tx))
            {
                throw new WireCardException("The specified transaction is invalid for this function type!");
            }

            this.transactions.Add(tx);
        }
Exemple #2
0
        public void AddTransaction(Transaction tx)
        {
            if (_transactions.Count == 5)
            {
                throw new WireCardException("Can't add more than 5 transactions to a single function!");
            }

            if (_transactions.Count > 0)
            {
                Type t = _transactions.First().GetType();

                if (tx.GetType() != t)
                {
                    throw new WireCardException("A single function can only contain transactions of the same type!");
                }
            }

            if (!IsTransactionAcceptable(tx))
            {
                throw new WireCardException("The specified transaction is invalid for this function type!");
            }

            _transactions.Add(tx);
        }