private void openToolStripMenuItem_Click(object sender, EventArgs e) { var navigate = new NavigateToObjectUI(Activator); navigate.CompletionAction = (o) => Activator.WindowArranger.SetupEditAnything(this, o); navigate.Show(); }
private void AddObjectToSession(object sender, EventArgs e) { var ui = new NavigateToObjectUI(Activator); ui.CompletionAction = (s) => Add(s); ui.Show(); }
public override void SetItemActivator(IActivateItems activator) { _activator = activator; CommonTreeFunctionality.SetUp( RDMPCollection.DataExport, tlvDataExport, _activator, olvName, olvName ); CommonTreeFunctionality.WhitespaceRightClickMenuCommandsGetter = (a) => new IAtomicCommand[] { new ExecuteCommandCreateNewDataExtractionProject(a), new ExecuteCommandCreateNewExtractableDataSetPackage(a) }; CommonTreeFunctionality.MaintainRootObjects = new Type[] { typeof(ExtractableDataSetPackage), typeof(Project) }; var dataExportChildProvider = activator.CoreChildProvider as DataExportChildProvider; if (dataExportChildProvider != null) { tlvDataExport.AddObjects(dataExportChildProvider.AllPackages); tlvDataExport.AddObjects(dataExportChildProvider.Projects); } NavigateToObjectUI.RecordThatTypeIsNotAUsefulParentToShow(typeof(ProjectCohortIdentificationConfigurationAssociationsNode)); }
public override void SelectAnythingThen(DialogArgs args, Action <IMapsDirectlyToDatabaseTable> callback) { NavigateToObjectUI navigate = new NavigateToObjectUI(this) { Text = args.WindowTitle }; navigate.CompletionAction = callback; navigate.Show(); }
public void SetUp(IActivateItems activator, string title, Type openType, AtomicCommandUIFactory factory, params IAtomicCommand[] newCommands) { _openType = openType; if (!_doneSetup) { _activator = activator; lblTitle.Text = title; btnNew.Image = FamFamFamIcons.add; btnNew.Text = "New"; btnNew.DisplayStyle = ToolStripItemDisplayStyle.Text; btnNewDropdown.Image = FamFamFamIcons.add; btnNewDropdown.Text = "New..."; btnNewDropdown.DisplayStyle = ToolStripItemDisplayStyle.Text; btnOpen.Text = "Open"; btnOpen.DisplayStyle = ToolStripItemDisplayStyle.Text; btnOpen.Click += (s, e) => { var ui = new NavigateToObjectUI(activator); ui.AlwaysFilterOn = openType; ui.CompletionAction = Open; ui.Show(); }; //if there's only one command for new if (newCommands.Length == 1) { //don't use the dropdown toolStrip1.Items.Remove(btnNewDropdown); btnNew.Click += (s, e) => newCommands.Single().Execute(); } else { toolStrip1.Items.Remove(btnNew); btnNewDropdown.DropDownItems.AddRange(newCommands.Select(factory.CreateMenuItem).Cast <ToolStripItem>().ToArray()); } olvName.AspectGetter = (o) => ((HistoryEntry)o).Object.ToString(); CommonTreeFunctionality.SetUp(RDMPCollection.None, olvRecent, activator, olvName, olvName, new RDMPCollectionCommonFunctionalitySettings() { SuppressChildrenAdder = true }); _doneSetup = true; } RefreshHistory(); }
public override void Execute() { base.Execute(); NavigateToObjectUI navigate = new NavigateToObjectUI(Activator) { Text = "Add Favourite" }; navigate.CompletionAction = (a) => { if (Activator.FavouritesProvider.IsFavourite(a)) { Show($"'{a}' is already a Favourite"); } else { Activator.FavouritesProvider.AddFavourite(this, a); } }; navigate.Show(); }