/// <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; } }
protected void DeleteLicense() { // Sanity check ensure only row selected if (licensesGridView.Selected.Rows.Count == 0) { return; } foreach (UltraGridRow selectedRow in this.licensesGridView.Selected.Rows) { //...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 delete the currently selected license wiController.DeleteLicense(theLicense); } // refresh the tab view ApplicationsWorkItem appWorkItem = WorkItem as ApplicationsWorkItem; appWorkItem.ExplorerView.RefreshView(); appWorkItem.GetActiveTabView().RefreshView(); }