Example #1
0
 /// <summary>
 ///     打开端口
 /// </summary>
 /// <param name="type"></param>
 /// <param name="index"></param>
 /// <returns></returns>
 public static bool OpenPrinter(TxTypeEnum type, int index)
 {
     return(TxOpenPrinter((uint)type, (UIntPtr)index));
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="Transaction" /> class.
 /// </summary>
 /// <param name="applicationTransaction">applicationTransaction.</param>
 /// <param name="assetConfigTransaction">assetConfigTransaction.</param>
 /// <param name="assetFreezeTransaction">assetFreezeTransaction.</param>
 /// <param name="assetTransferTransaction">assetTransferTransaction.</param>
 /// <param name="authAddr">\\[sgnr\\] The address used to sign the transaction. This is used for rekeyed accounts to indicate that the sender address did not sign the transaction..</param>
 /// <param name="closeRewards">\\[rc\\] rewards applied to close-remainder-to account..</param>
 /// <param name="closingAmount">\\[ca\\] closing amount for transaction..</param>
 /// <param name="confirmedRound">Round when the transaction was confirmed..</param>
 /// <param name="createdApplicationIndex">Specifies an application index (ID) if an application was created with this transaction..</param>
 /// <param name="createdAssetIndex">Specifies an asset index (ID) if an asset was created with this transaction..</param>
 /// <param name="fee">\\[fee\\] Transaction fee. (required).</param>
 /// <param name="firstValid">\\[fv\\] First valid round for this transaction. (required).</param>
 /// <param name="genesisHash">\\[gh\\] Hash of genesis block..</param>
 /// <param name="genesisId">\\[gen\\] genesis block ID..</param>
 /// <param name="globalStateDelta">globalStateDelta.</param>
 /// <param name="group">\\[grp\\] Base64 encoded byte array of a sha512/256 digest. When present indicates that this transaction is part of a transaction group and the value is the sha512/256 hash of the transactions in that group..</param>
 /// <param name="id">Transaction ID (required).</param>
 /// <param name="intraRoundOffset">Offset into the round where this transaction was confirmed..</param>
 /// <param name="keyregTransaction">keyregTransaction.</param>
 /// <param name="lastValid">\\[lv\\] Last valid round for this transaction. (required).</param>
 /// <param name="lease">\\[lx\\] Base64 encoded 32-byte array. Lease enforces mutual exclusion of transactions.  If this field is nonzero, then once the transaction is confirmed, it acquires the lease identified by the (Sender, Lease) pair of the transaction until the LastValid round passes.  While this transaction possesses the lease, no other transaction specifying this lease can be confirmed..</param>
 /// <param name="localStateDelta">\\[ld\\] Local state key/value changes for the application being executed by this transaction..</param>
 /// <param name="note">\\[note\\] Free form data..</param>
 /// <param name="paymentTransaction">paymentTransaction.</param>
 /// <param name="receiverRewards">\\[rr\\] rewards applied to receiver account..</param>
 /// <param name="rekeyTo">\\[rekey\\] when included in a valid transaction, the accounts auth addr will be updated with this value and future signatures must be signed with the key represented by this address..</param>
 /// <param name="roundTime">Time when the block this transaction is in was confirmed..</param>
 /// <param name="sender">\\[snd\\] Sender&#x27;s address. (required).</param>
 /// <param name="senderRewards">\\[rs\\] rewards applied to sender account..</param>
 /// <param name="signature">signature (required).</param>
 /// <param name="txType">\\[type\\] Indicates what type of transaction this is. Different types have different fields.  Valid types, and where their fields are stored: * \\[pay\\] payment-transaction * \\[keyreg\\] keyreg-transaction * \\[acfg\\] asset-config-transaction * \\[axfer\\] asset-transfer-transaction * \\[afrz\\] asset-freeze-transaction * \\[appl\\] application-transaction (required).</param>
 public Transaction(TransactionApplication applicationTransaction = default(TransactionApplication), TransactionAssetConfig assetConfigTransaction = default(TransactionAssetConfig), TransactionAssetFreeze assetFreezeTransaction = default(TransactionAssetFreeze), TransactionAssetTransfer assetTransferTransaction = default(TransactionAssetTransfer), string authAddr = default(string), long?closeRewards = default, long?closingAmount = default, long?confirmedRound = default, long?createdApplicationIndex = default, long?createdAssetIndex = default, long?fee = default, long?firstValid = default, byte[] genesisHash = default(byte[]), string genesisId = default(string), StateDelta globalStateDelta = default, byte[] group = default(byte[]), string id = default(string), long?intraRoundOffset = default, TransactionKeyreg keyregTransaction = default(TransactionKeyreg), long?lastValid = default, byte[] lease = default(byte[]), List <AccountStateDelta> localStateDelta = default(List <AccountStateDelta>), byte[] note = default(byte[]), TransactionPayment paymentTransaction = default(TransactionPayment), long?receiverRewards = default, string rekeyTo = default(string), long?roundTime = default, string sender = default(string), long?senderRewards = default, TransactionSignature signature = default(TransactionSignature), TxTypeEnum txType = default(TxTypeEnum))
 {
     // to ensure "fee" is required (not null)
     if (fee == null)
     {
         throw new InvalidDataException("fee is a required property for Transaction and cannot be null");
     }
     else
     {
         this.Fee = fee;
     }
     // to ensure "firstValid" is required (not null)
     if (firstValid == null)
     {
         throw new InvalidDataException("firstValid is a required property for Transaction and cannot be null");
     }
     else
     {
         this.FirstValid = firstValid;
     }
     // to ensure "id" is required (not null)
     if (id == null)
     {
         throw new InvalidDataException("id is a required property for Transaction and cannot be null");
     }
     else
     {
         this.Id = id;
     }
     // to ensure "lastValid" is required (not null)
     if (lastValid == null)
     {
         throw new InvalidDataException("lastValid is a required property for Transaction and cannot be null");
     }
     else
     {
         this.LastValid = lastValid;
     }
     // to ensure "sender" is required (not null)
     if (sender == null)
     {
         throw new InvalidDataException("sender is a required property for Transaction and cannot be null");
     }
     else
     {
         this.Sender = sender;
     }
     // to ensure "signature" is required (not null)
     if (signature == null)
     {
         throw new InvalidDataException("signature is a required property for Transaction and cannot be null");
     }
     else
     {
         this.Signature = signature;
     }
     // to ensure "txType" is required (not null)
     if (txType == null)
     {
         throw new InvalidDataException("txType is a required property for Transaction and cannot be null");
     }
     else
     {
         this.TxType = txType;
     }
     this.ApplicationTransaction   = applicationTransaction;
     this.AssetConfigTransaction   = assetConfigTransaction;
     this.AssetFreezeTransaction   = assetFreezeTransaction;
     this.AssetTransferTransaction = assetTransferTransaction;
     this.AuthAddr                = authAddr;
     this.CloseRewards            = closeRewards;
     this.ClosingAmount           = closingAmount;
     this.ConfirmedRound          = confirmedRound;
     this.CreatedApplicationIndex = createdApplicationIndex;
     this.CreatedAssetIndex       = createdAssetIndex;
     this.GenesisHash             = genesisHash;
     this.GenesisId               = genesisId;
     this.GlobalStateDelta        = globalStateDelta;
     this.Group             = group;
     this.IntraRoundOffset  = intraRoundOffset;
     this.KeyregTransaction = keyregTransaction;
     this.Lease             = lease;
     this.LocalStateDelta   = localStateDelta;
     this.Note = note;
     this.PaymentTransaction = paymentTransaction;
     this.ReceiverRewards    = receiverRewards;
     this.RekeyTo            = rekeyTo;
     this.RoundTime          = roundTime;
     this.SenderRewards      = senderRewards;
 }