public void RemoveTrigger(Trigger trigger) { _triggers.Remove(trigger); trigger.Dispose(); }
private void listTriggers_MouseDoubleClick(object sender, MouseEventArgs e) { var dlg = new TriggerDlg(); var selectedTrigger = listTriggers.SelectedItem as Trigger; var editTrigger = new Trigger(); selectedTrigger.CopyPublicValues(editTrigger); dlg.Trigger = editTrigger; dlg.Scene = Scene; if (dlg.ShowDialog(this) == DialogResult.OK) { Scene.RemoveTrigger(selectedTrigger); Scene.AddTrigger(dlg.Trigger); UpdateTriggerList(); } }
public void AddTrigger(Trigger trigger) { trigger.Scene = this; if (Loaded) trigger.Load(); _triggers.Add(trigger); }