コード例 #1
0
ファイル: VotingService.cs プロジェクト: Br3nda/sfdocsamples
        public void ShowVotingDialog(VotingServiceEventArgs votingEventArgs)
        {
            DialogResult result;
            string       alias = votingEventArgs.Alias;

            // Show the voting dialog to the user and depending on the response
            // raise the ApproveProposal or RejectProposal event back to the workflow
            result = MessageBox.Show(string.Format("Approve Proposal, {0}?", alias), string.Format("{0} Ballot", alias), MessageBoxButtons.YesNo);
            if (result == DialogResult.Yes)
            {
                EventHandler <VotingServiceEventArgs> approvedProposal = this.ApprovedProposal;
                if (approvedProposal != null)
                {
                    approvedProposal(null, votingEventArgs);
                }
            }
            else
            {
                EventHandler <VotingServiceEventArgs> rejectedProposal = this.RejectedProposal;
                if (rejectedProposal != null)
                {
                    rejectedProposal(null, votingEventArgs);
                }
            }
        }
コード例 #2
0
ファイル: VotingService.cs プロジェクト: spzenk/sfdocsamples
        public void ShowVotingDialog(VotingServiceEventArgs votingEventArgs)
        {
            DialogResult result;
            string alias = votingEventArgs.Alias;

            // Show the voting dialog to the user and depending on the response
            // raise the ApproveProposal or RejectProposal event back to the workflow
            result = MessageBox.Show(string.Format("Approve Proposal, {0}?", alias), string.Format("{0} Ballot", alias), MessageBoxButtons.YesNo);
            if (result == DialogResult.Yes)
            {
                EventHandler<VotingServiceEventArgs> approvedProposal = this.ApprovedProposal;
                if (approvedProposal != null)
                    approvedProposal(null, votingEventArgs);
            }
            else
            {
                EventHandler<VotingServiceEventArgs> rejectedProposal = this.RejectedProposal;
                if (rejectedProposal != null)
                    rejectedProposal(null, votingEventArgs);
            }
        }