public void CommonItemActivation(object sender, EventArgs eventArgs) { var o = Tree.SelectedObject; if (o == null) { return; } if (UserSettings.DoubleClickToExpand) { if (Tree.CanExpand(o) && !Tree.IsExpanded(o)) { Tree.Expand(o); return; } if (Tree.IsExpanded(o)) { Tree.Collapse(o); return; } } var cmd = new ExecuteCommandActivate(_activator, o); if (!cmd.IsImpossible) { cmd.Execute(); } }
public void SetupEditAnything(object sender, IMapsDirectlyToDatabaseTable o) { _windowManager.CloseAllToolboxes(); _windowManager.CloseAllWindows(); if (o is LoadMetadata lmd) { SetupEditLoadMetadata(sender, lmd); } else { _activator.RequestItemEmphasis(this, new EmphasiseRequest(o, int.MaxValue)); var activate = new ExecuteCommandActivate(_activator, o); //activate it if possible if (!activate.IsImpossible) { activate.Execute(); } else { _activator.RequestItemEmphasis(this, new EmphasiseRequest(o, 1)); //otherwise just show it } } }
public override void Activate(DatabaseEntity o) { var cmd = new ExecuteCommandActivate(this, o); if (!cmd.IsImpossible) { cmd.Execute(); } }
private void olvAvailable_ItemActivate(object sender, EventArgs e) { var cmd = new ExecuteCommandActivate(Activator, olvAvailable.SelectedObject); if (!cmd.IsImpossible) { cmd.Execute(); } }
private void tlvAllObjects_ItemActivate(object sender, EventArgs e) { var node = olvAllObjects.SelectedObject as FindAndReplaceNode; if (node != null) { var cmd = new ExecuteCommandActivate(Activator, node.Instance); if (!cmd.IsImpossible) { cmd.Execute(); } } }
private void AddNewDashboard() { var dialog = new TypeTextOrCancelDialog("Dashboard Name", "Name", 100, null, false); if (dialog.ShowDialog() == DialogResult.OK) { var dash = new DashboardLayout(_manager.RepositoryLocator.CatalogueRepository, dialog.ResultText); var cmd = new ExecuteCommandActivate(_manager.ActivateItems, dash); cmd.Execute(); ReCreateDropDowns(); } }
public void SetupEditAnything(object sender, IMapsDirectlyToDatabaseTable o) { _activator.RequestItemEmphasis(this, new EmphasiseRequest(o, int.MaxValue)); var activate = new ExecuteCommandActivate(_activator, o); //activate it if possible if (!activate.IsImpossible) { activate.Execute(); } else { _activator.RequestItemEmphasis(this, new EmphasiseRequest(o, 1)); //otherwise just show it } }
private void AddNewLayout() { string xml = _manager.MainForm.GetCurrentLayoutXml(); var dialog = new TypeTextOrCancelDialog("Layout Name", "Name", 100, null, false); if (dialog.ShowDialog() == DialogResult.OK) { var layout = new WindowLayout(_manager.RepositoryLocator.CatalogueRepository, dialog.ResultText, xml); var cmd = new ExecuteCommandActivate(_manager.ActivateItems, layout); cmd.Execute(); ReCreateDropDowns(); } }
public void CommonItemActivation(object sender, EventArgs eventArgs) { var o = Tree.SelectedObject; if (o == null) { return; } var cmd = new ExecuteCommandActivate(_activator, o); if (!cmd.IsImpossible) { cmd.Execute(); } }
private void cbx_DropDownClosed(object sender, EventArgs e) { var cbx = (ToolStripComboBox)sender; var toOpen = cbx.SelectedItem as INamed; if (ReferenceEquals(cbx.SelectedItem, CreateNewLayout)) { AddNewLayout(); } if (toOpen != null) { var cmd = new ExecuteCommandActivate(_manager.ActivateItems, toOpen); cmd.Execute(); } UpdateButtonEnabledness(); }
private void Open(IMapsDirectlyToDatabaseTable o) { if (!((DatabaseEntity)o).Exists()) { if (_activator.YesNo($"'{o}' no longer exists, remove from Recent list?", "No longer exists")) { _activator.HistoryProvider.Remove(o); RefreshHistory(); } return; } var cmd = new ExecuteCommandActivate(_activator, o) { AlsoShow = true }; cmd.Execute(); }
protected void Activate(DatabaseEntity o) { var cmd = new ExecuteCommandActivate(_activator, o); cmd.Execute(); }