/// <summary> /// Find the currently open <c>FirstPastThePostForm</c> instance /// </summary> private void InitFormReference() { // get the voting form foreach (Form form in Application.OpenForms) { if (form.GetType().Equals(typeof(FirstPastThePostForm))) { FPTPform = (FirstPastThePostForm)form; break; } } }
private void button1_Click(object sender, EventArgs e) { if (model.ValidatePick()) { this.Hide(); // load alternative voting form if (model.GetVotingType() == 1) { var AltVotingForm = new AlternativeVoting(this.model.Backend); AltVotingForm.ShowDialog(); this.Close(); } // load standard voting form if (model.GetVotingType() == 0) { var FPTPForm = new FirstPastThePostForm(this.model.Backend); FPTPForm.ShowDialog(); this.Close(); } } }