public CohortIdentificationConfigurationMenu(RDMPContextMenuStripArgs args, CohortIdentificationConfiguration cic) : base(args, cic) { _cic = cic; Items.Add("View SQL", _activator.CoreIconProvider.GetImage(RDMPConcept.SQL), (s, e) => _activator.Activate <ViewCohortIdentificationConfigurationUI, CohortIdentificationConfiguration>(cic)); Items.Add(new ToolStripSeparator()); _executeAndImportCommand = new ExecuteCommandCreateNewCohortByExecutingACohortIdentificationConfiguration(_activator).SetTarget(cic); Add(_executeAndImportCommand); //associate with project Add(new ExecuteCommandAssociateCohortIdentificationConfigurationWithProject(_activator).SetTarget(cic)); Items.Add(new ToolStripSeparator()); _executeCommandClone = new ExecuteCommandCloneCohortIdentificationConfiguration(_activator).SetTarget(cic); Add(_executeCommandClone); Add(new ExecuteCommandFreezeCohortIdentificationConfiguration(_activator, cic, !cic.Frozen)); Items.Add(new ToolStripSeparator()); Add(new ExecuteCommandCreateNewCohortIdentificationConfiguration(_activator)); Add(new ExecuteCommandSetQueryCachingDatabase(_activator, cic)); Add(new ExecuteCommandCreateNewQueryCacheDatabase(_activator, cic)); }
public CohortIdentificationConfigurationMenu(RDMPContextMenuStripArgs args, CohortIdentificationConfiguration cic): base(args, cic) { _cic = cic; Items.Add("View SQL", _activator.CoreIconProvider.GetImage(RDMPConcept.SQL), (s, e) => _activator.Activate<ViewCohortIdentificationConfigurationUI, CohortIdentificationConfiguration>(cic)); Items.Add(new ToolStripSeparator()); _executeAndImportCommand = new ExecuteCommandCreateNewCohortByExecutingACohortIdentificationConfiguration(_activator).SetTarget(cic); Add(_executeAndImportCommand); //associate with project Add(new ExecuteCommandAssociateCohortIdentificationConfigurationWithProject(_activator).SetTarget(cic)); Items.Add(new ToolStripSeparator()); _executeCommandClone = new ExecuteCommandCloneCohortIdentificationConfiguration(_activator).SetTarget(cic); Add(_executeCommandClone); Add(new ExecuteCommandFreezeCohortIdentificationConfiguration(_activator, cic, !cic.Frozen)); Items.Add(new ToolStripSeparator()); Add(new ExecuteCommandCreateNewCohortIdentificationConfiguration(_activator)); if(_activator.CoreChildProvider is DataExportChildProvider dx) AddGoTo(()=>dx.AllProjectAssociatedCics.Where(a=>a.CohortIdentificationConfiguration_ID == cic.ID).Select(a=>a.Project).Distinct(),"Project(s)"); }
private void AddCommand <T>(IAtomicCommandWithTarget command, IEnumerable <T> selection, Func <T, string> propertySelector, TableLayoutPanel tableLayoutPanel) { var control = _uiFactory.CreateLinkLabelWithSelection(command, selection, propertySelector); SetBackgroundColor(tableLayoutPanel, control); tableLayoutPanel.Controls.Add(control, 0, tableLayoutPanel.Controls.Count); //extend the size to match var panel = (Panel)tableLayoutPanel.Parent; panel.Width = Math.Max(panel.Width, control.Width + 10); }
public AtomicCommandWithTargetUI(IIconProvider iconProvider, IAtomicCommandWithTarget command, IEnumerable <T> selection, Func <T, string> propertySelector) { _command = command; InitializeComponent(); _selection = selection.ToArray(); pbCommandIcon.Image = command.GetImage(iconProvider); helpIcon1.BackgroundImage = iconProvider.GetImage(RDMPConcept.Help); string name = command.GetCommandName(); lblName.Text = name; helpIcon1.SetHelpText(_command.GetCommandName(), _command.GetCommandHelp()); selectIMapsDirectlyToDatabaseTableComboBox1.SetUp(_selection.Cast <IMapsDirectlyToDatabaseTable>().ToArray()); selectIMapsDirectlyToDatabaseTableComboBox1.SelectedItemChanged += suggestComboBox1_SelectedIndexChanged; lblGo.Enabled = false; Enabled = _selection.Any(); }
public AtomicCommandWithTargetUI <T> CreateLinkLabelWithSelection <T>(IAtomicCommandWithTarget command, IEnumerable <T> selection, Func <T, string> propertySelector) { return(new AtomicCommandWithTargetUI <T>(_iconProvider, command, selection, propertySelector)); }