private void addProjectButton_Click(object sender, System.EventArgs e) { ProjectForm form = new ProjectForm(new Project()); form.Show(); form.Closed += new EventHandler(form_Closed); }
private void propertiesMenuItem_Click(object sender, System.EventArgs e) { IEnumerator enumr = this.projectListView.SelectedIndices.GetEnumerator(); enumr.MoveNext(); Project p = ((Project)this._settings.Projects.ToArray()[(int)enumr.Current]); ProjectForm pf = new ProjectForm(p); pf.Closed += new EventHandler(form_Closed); pf.Show(); }
private void form_Closed(object sender, EventArgs e) { if (sender is ProjectForm) { ProjectForm pf = (ProjectForm)sender; Project project = pf.Project; if (project != null) { if (!_settings.Projects.Contains(project)) { project.OnPolled += new PolledEventHandler(Project_OnPolled); _settings.Projects.Add(project); monitor.visitProject(project); } UpdateProjectList(); } } }