private IEnumerable <IAtomicCommand> GetExtraCommands(object o) { if (CommandFactoryBase.Is(o, out LoadMetadata lmd)) { yield return(new ExecuteCommandRunConsoleGuiView(_activator, () => new RunDleWindow(_activator, lmd)) { OverrideCommandName = "Execute Load..." }); } if (CommandFactoryBase.Is(o, out Project p)) { yield return(new ExecuteCommandRunConsoleGuiView(_activator, () => new RunReleaseWindow(_activator, p)) { OverrideCommandName = "Release..." }); } if (CommandFactoryBase.Is(o, out ExtractionConfiguration ec)) { yield return(new ExecuteCommandRunConsoleGuiView(_activator, () => new RunReleaseWindow(_activator, ec)) { OverrideCommandName = "Release..." }); yield return(new ExecuteCommandRunConsoleGuiView(_activator, () => new RunExtractionWindow(_activator, ec)) { OverrideCommandName = "Extract..." }); } if (CommandFactoryBase.Is(o, out CacheProgress cp)) { yield return(new ExecuteCommandRunConsoleGuiView(_activator, () => new RunCacheWindow(_activator, cp)) { OverrideCommandName = "Run Cache..." }); } if (CommandFactoryBase.Is(o, out Catalogue c) && !c.IsApiCall()) { yield return(new ExecuteCommandRunConsoleGuiView(_activator, () => new RunDataQualityEngineWindow(_activator, c)) { OverrideCommandName = "Run DQE..." }); } }
internal IEnumerable <ContextMenuItem> AssociationMenuItems() { ContextMenuItem addCommentary = new ContextMenuItem("Add commentary"); addCommentary.Icon = ContextMenuIcon.GetContextIcon("comment"); addCommentary.Click += delegate { NewModelCommentToDiagramCommand command = (NewModelCommentToDiagramCommand)CommandFactoryBase <NewModelCommentaryToDiagramCommandFactory> .Factory().Create(Controller.DiagramController); command.AnnotatedElement = Association; if (Diamond != null) { command.X = Diamond.Left + Diamond.ActualWidth + 20; command.Y = Diamond.Top + 20; } else { Point p = FindClosestPoint(simpleAssociationJunction.GetBounds().GetCenter()); command.X = p.X + 20; command.Y = p.Y + 20; } command.Set(Controller.DiagramController.ModelController, null); command.Execute(); }; ContextMenuItem demo = new ContextMenuItem("Binding demo - show that binding to association properties works"); demo.Click += demo_Click; ContextMenuItem resetLabels = new ContextMenuItem("Reset all labels position"); resetLabels.Click += delegate { ResetAllLabelsPositions(); }; ContextMenuItem switchDiamond = new ContextMenuItem("Switch diamond "); switchDiamond.Click += delegate { ViewController.SwitchAssociationDiamond(ViewHelper, Association, Controller.DiagramController); }; return(new[] { resetLabels, #if DEBUG demo, #endif addCommentary, switchDiamond }); }
/// <summary> /// Returns context menu items. /// </summary> /// <returns></returns> internal IEnumerable <ContextMenuItem> GeneralizationMenuItems() { ContextMenuItem addCommentary = new ContextMenuItem("Add commentary"); addCommentary.Click += delegate { NewModelCommentToDiagramCommand command = (NewModelCommentToDiagramCommand)CommandFactoryBase <NewModelCommentaryToDiagramCommandFactory> .Factory().Create(Controller.DiagramController); command.AnnotatedElement = Generalization; Point p = JunctionGeometryHelper.FindClosestPoint(GeneralizationJunction, GeneralizationJunction.GetBounds().GetCenter()); command.X = p.X + 20; command.Y = p.Y + 20; command.Set(Controller.DiagramController.ModelController, null); command.Execute(); }; return(new ContextMenuItem[] { addCommentary }); }