/// <summary> /// This is the tool click handler for the Applications>Licensing ribbon group /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void licensing_ToolClick(object sender, ToolClickEventArgs e) { ApplicationsWorkItemController controller = workItem.Controller as ApplicationsWorkItemController; switch (e.Tool.SharedProps.Caption) { case ToolNames.SetIgnored: controller.SetIgnored(); break; case ToolNames.SetIncluded: controller.SetIncluded(); break; case ToolNames.NewLicense: controller.NewLicense(); break; case ToolNames.EditLicense: controller.EditLicense(); break; case ToolNames.DeleteLicense: controller.DeleteLicense(); break; default: break; } }
/// <summary> /// Called to edit the currently selected license (if any) /// </summary> protected void EditLicense() { // Sanity check ensure only row selected if (licensesGridView.Selected.Rows.Count != 1) { return; } //...and get the license object UltraGridRow selectedRow = this.licensesGridView.Selected.Rows[0]; ApplicationLicense theLicense = selectedRow.Cells[0].Value as ApplicationLicense; // Get our controller ApplicationsWorkItemController wiController = WorkItem.Controller as ApplicationsWorkItemController; // ...and request it to edit the currently selected license wiController.EditLicense(theLicense); }