private void NewPointForm_Load(object sender, EventArgs e)
        {
            rad_homeWrestler.Text = CurrentHomeWrestler.LastName + ", " + CurrentHomeWrestler.FirstName;
            rad_awayWrestler.Text = CurrentAwayWrestler.LastName + ", " + CurrentAwayWrestler.FirstName;

            if (NewPoint.HomeScored != null)
            {
                if (NewPoint.HomeScored == true)
                {
                    rad_homeWrestler.Checked = true;
                }
                else
                {
                    rad_awayWrestler.Checked = true;
                }
            }

            cmb_allScoringMethods.Items.Clear();
            PointMethod allPointMethods = new PointMethod();

            foreach (var point in allPointMethods.AllPointMethods)
            {
                cmb_allScoringMethods.Items.Add(point);
            }

            if (NewPoint.MethodScored != null)
            {
                cmb_allScoringMethods.SelectedItem = NewPoint.MethodScored;
            }
        }
        private void btn_submit_Click(object sender, EventArgs e)
        {
            bool isValid = ValidateForm();

            if (isValid)
            {
                PointMethod allPointsMethods = new PointMethod();

                NewPoint = new Classes.Point();
                NewPoint.MethodScored = ((Method)cmb_allScoringMethods.SelectedItem).MethodScored;
                NewPoint.PointValue   = ((Method)cmb_allScoringMethods.SelectedItem).Value;
                NewPoint.HomeScored   = (rad_homeWrestler.Checked == true) ? true : false;
                NewPoint.HomeWrestler = new Wrestler(CurrentHomeWrestler);
                NewPoint.AwayWrestler = new Wrestler(CurrentAwayWrestler);

                if (VideoDirectory != null)
                {
                    NewPoint.VideoDirectory = VideoDirectory;
                }
                else
                {
                    NewPoint.VideoDirectory = "novideo";
                }
                this.Close();
            }
            else
            {
                MessageBox.Show("Please select a wrestler and a point method");
            }
        }
Example #3
0
    public void TestAsyncCallWithValueTypes()
    {
        Point        result;
        IAsyncResult ar;
        PointMethod  m = new PointMethod(PointAdd);

        ar = m.BeginInvoke(new Point(10, 20), new Point(30, 40), null, null);

        result = m.EndInvoke(ar);

        AssertEquals("result==Point(40, 60)", new Point(40, 60), result);
    }
	public void TestAsyncCallWithValueTypes()
	{
		Point result;
		IAsyncResult ar;
		PointMethod m = new PointMethod(PointAdd);
		
		ar = m.BeginInvoke(new Point(10, 20), new Point(30, 40), null, null);
		
		result = m.EndInvoke(ar);
		
		AssertEquals("result==Point(40, 60)", new Point(40, 60), result);
	}