コード例 #1
0
 private void _summaryWindow_ReturnToVoting(object sender, VoteCastEventArgs e)
 {
     try
     {
         //Vote has not been cast, switch back to voting form
         ContentArea.Content = _voteWindow;
     }
     catch (Exception)
     {
         MessageBox.Show(
             "An error occurred, please contact person responsible for managing the system",
             "Error occured", MessageBoxButton.OK);
         Logout();
     }
 }
コード例 #2
0
        private void _voteWindow_GoToSummary(object sender, VoteCastEventArgs e)
        {
            try
            {
                //Initialize and switch to summary window, pass list of chosen candidates
                if (_summaryWindow == null)
                {
                    _summaryWindow = new SummaryWindow(this);
                    _summaryWindow.ReturnToVoting += _summaryWindow_ReturnToVoting;
                    _summaryWindow.VoteCasted     += _summaryWindow_VoteCasted;
                }

                _summaryWindow.SetCandidates(e.Candidates);

                ContentArea.Content = _summaryWindow;
            }
            catch (Exception)
            {
                MessageBox.Show(
                    "An error occurred, please contact person responsible for managing the system",
                    "Error occured", MessageBoxButton.OK);
                Logout();
            }
        }