コード例 #1
0
        /// <summary>
        /// Instantiate default sub-controller.
        /// </summary>
        private void InitDefault()
        {
            VoterSelectionWindow vsView = view.VoterSelectionView;

            vsView.AddVCGClickedHandler(model.OpenSubModel);
            vsView.AddVBMClickedHandler(model.OpenSubModel);
            vsController = new VoterSelectionController(model.VoterSelection, view.VoterSelectionView);
        }
コード例 #2
0
        /// <summary> Initializes a new instance of the <see cref="VoterSelectionController"/> class. </summary>
        /// <param name="mainModel"> The main model. </param>
        /// <param name="view"> A voter selection view. </param>
        public VoterSelectionController(VoterSelection mainModel, VoterSelectionWindow view)
        {
            this.mainModel = mainModel;
            this.view = view;

            view.AddPSSelectionChangedHandler(this.PSSelectionChanged);
            view.AddMSelectionChangedHandler(this.MSelectionChanged);
            view.addCPRTextChangedHandler(this.CPRTextChanged);

            this.view.Closed += (o, eA) => Environment.Exit(-1);
        }
コード例 #3
0
        /// <summary> Initializes a new instance of the <see cref="VoterSelectionController"/> class. </summary>
        /// <param name="mainModel"> The main model. </param>
        /// <param name="view"> A voter selection view. </param>
        public VoterSelectionController(VoterSelection mainModel, VoterSelectionWindow view)
        {
            this.mainModel = mainModel;
            this.view      = view;

            view.AddPSSelectionChangedHandler(this.PSSelectionChanged);
            view.AddMSelectionChangedHandler(this.MSelectionChanged);
            view.addCPRTextChangedHandler(this.CPRTextChanged);

            this.view.Closed += (o, eA) => Environment.Exit(-1);
        }