public NewCampaignDialog(Calendar cal, TreeView cTree, CampaignViewer cviewer) { InitializeComponent(); currentCalendar = cal; campaignTree = cTree; Cviewer = cviewer; campaignToAdd = null; }
private void campaignButton_Click(object sender, EventArgs e) { if (campaignViewer == null) { campaignViewer = new CampaignViewer(currentCalendar); campaignViewer.Show(this); } else if (campaignViewer.IsDisposed) { campaignViewer = new CampaignViewer(currentCalendar); campaignViewer.Show(this); } }
// This constructor is called if a campaign is passed to it, turning the dialog into an 'edit campaign' dialog // Throughout the form, it checks to see if editCampaign is null, if it is, that means it's a 'new campaign' form public NewCampaignDialog(Calendar cal, Campaign editCampaign, TreeView cTree, CampaignViewer cviewer) : this(cal, cTree, cviewer) { campaignToAdd = editCampaign; nameBox.Text = campaignToAdd.Name; tagBox.Text = campaignToAdd.Tag; startM.Text = campaignToAdd.findNote(campaignToAdd.Name + " began!").Date.Substring(0, 2); startD.Text = campaignToAdd.findNote(campaignToAdd.Name + " began!").Date.Substring(2, 2); startY.Text = campaignToAdd.findNote(campaignToAdd.Name + " began!").Date.Substring(4, 4); currM.Text = campaignToAdd.CurrentDate.Substring(0, 2); currD.Text = campaignToAdd.CurrentDate.Substring(2, 2); currY.Text = campaignToAdd.CurrentDate.Substring(4, 4); this.Text = "Edit Campaign"; }