private void fieldLink1_OnClick() { int max = types.Max(t => t.LevelNumber); AdminLevelType type = new AdminLevelType { LevelNumber = max + 1 }; AdminLevelTypeAdd add = new AdminLevelTypeAdd(type); // Tell the control if is being launched from StartUp add.IsStartUp = IsStartUp; add.OnSave += () => { RefreshList(); }; add.ShowDialog(); }
private void lvLevels_HyperlinkClicked(object sender, BrightIdeasSoftware.HyperlinkClickedEventArgs e) { e.Handled = true; if (e.Column.AspectName == "EditText") { AdminLevelTypeAdd add = new AdminLevelTypeAdd((AdminLevelType)e.Model); // Tell the control if is being launched from StartUp add.IsStartUp = IsStartUp; add.OnSave += () => { RefreshList(); }; add.ShowDialog(); } else if (e.Column.AspectName == "DeleteText") { r.Delete((AdminLevelType)e.Model, ApplicationData.Instance.GetUserId()); RefreshList(); } else if (e.Column.AspectName == "ImportText") { WizardForm wiz = new WizardForm(new StepAdminLevelImport((AdminLevelType)e.Model, null, null), Translations.Import); wiz.OnFinish = () => { }; wiz.OnClose = () => { }; wiz.ShowDialog(); } }