/// <summary> /// Create a new vote cast opeation. /// </summary> /// <param name="votingMaterial">Material to vote.</param> /// <param name="voterCertificate">Certificate of the voter.</param> /// <param name="vota">Selected options.</param> /// <param name="callBack">Callback upon completion.</param> public VoteOperation(VotingMaterial votingMaterial, Certificate voterCertificate, IEnumerable<IEnumerable<bool>> vota, VoteCallBack callBack) { this.votingMaterial = votingMaterial; this.voterCertificate = voterCertificate; this.vota = vota; this.callBack = callBack; }
/// <summary> /// Send vote to server. /// </summary> /// <param name="votingMaterial">Material to vote.</param> /// /// <param name="voterCertificate">Certificate of the voter.</param> /// <param name="vota">Selected options.</param> /// <param name="callBack">Callback upon completion.</param> public void Vote(VotingMaterial votingMaterial, VoterCertificate voterCertificate, IEnumerable<IEnumerable<bool>> vota, VoteCallBack callBack) { lock (this.operations) { this.operations.Enqueue(new VoteOperation(votingMaterial, voterCertificate, vota, callBack)); } }