Next: Wizard Forms Need ties to underlying model objects

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Text;
using System.Windows.Forms;

namespace MhsController.Forms
{
    public partial class wpAnotherRandomPointWizardPage : YesNoWizardPage
    {
        public WaypointController Waypoint
        {
            get { return wp; }
            set { wp = value; }
        }
        private WaypointController wp = null;

[...snip...]
        // when this form is brought to the fore front it should recalculate its value based on the stored object
        private void wpAnotherRandomPointWizardPage_VisibleChanged(object sender, EventArgs e)
        {
            if (wp != null)
            {
                this.textBox1.Text = String.Format("You have sampled " +
                "{0} random reference spots, " +
                "{1} plant patches, " +
                "{2} species, and " +
                "{3} twigs at this " +
                "waypoint. Would you like to sample patches at another random spot?",

                Stats.ReferencePointCount(wp),
                Stats.PatchCount(wp),
                "##speciesCount##",
                Stats.CygCount(wp));
            }
        }

    }
}

Comments are closed.