public ApplicationDiagramPluginFactory( ILayoutPriorityProvider layoutPriorityProvider, IDiagramShapeFactory diagramShapeFactory, IHostUiServices hostUiServices) : base(layoutPriorityProvider, diagramShapeFactory) { _hostUiServices = hostUiServices; }
/// <summary> /// Creates a new instance. /// </summary> public DiagramToolApplication(IRoslynModelProvider roslynModelProvider, IHostUiServices hostUiServices) { _visualizationService = CreateVisualizationService(roslynModelProvider, hostUiServices); _diagramId = _visualizationService.CreateDiagram(AppDefaults.MinZoom, AppDefaults.MaxZoom, AppDefaults.InitialZoom); RoslynModelService.HideTrivialBaseNodes = AppDefaults.HideTrivialBaseNodes; ApplicationUiService.ImageExportDpi = Dpi.Dpi150; ApplicationUiService.DiagramNodeInvoked += OnShowSourceRequested; ApplicationUiService.ShowModelItemsRequested += OnShowItemsRequestedAsync; }
public RoslynUiService(IHostUiServices hostUiServices, RoslynDiagramViewModel diagramViewModel) : base(diagramViewModel) { _hostUiServices = hostUiServices; _diagramViewModel = diagramViewModel; _resourceDictionary = ResourceHelpers.GetResourceDictionary(DiagramStylesXaml, Assembly.GetExecutingAssembly()); _diagramControl = new DiagramControl(_resourceDictionary) { DataContext = _diagramViewModel }; Initialize(_resourceDictionary, _diagramControl); hostUiServices.HostDiagram(_diagramControl); }
public DiagramUi(IHostUiServices hostUiServices, IArrangedDiagram diagram) { _hostUiServices = hostUiServices; _resourceDictionary = ResourceHelpers.GetResourceDictionary(DiagramStylesXaml, Assembly.GetExecutingAssembly()); _diagramViewModel = new DiagramViewModel(diagram, minZoom: .1, maxZoom: 10, initialZoom: 1); _diagramControl = new DiagramControl(_resourceDictionary) { DataContext = _diagramViewModel }; hostUiServices.HostDiagram(_diagramControl); SubscribeToDiagramViewModelEvents(_diagramViewModel); }
private static RoslynVisualizationService CreateVisualizationService( IRoslynModelProvider roslynModelProvider, IHostUiServices hostUiServices) { return(new RoslynVisualizationService( new RoslynModelServiceFactory(roslynModelProvider), new RoslynDiagramServiceFactory(), new RoslynUiServiceFactory(hostUiServices, GlobalOptions.NodeDescriptionsVisibleByDefault), new RoslynDiagramPluginFactory(new RoslynLayoutPriorityProvider(), new RoslynDiagramShapeFactory()), new[] { DiagramPluginId.AutoLayoutDiagramPlugin, DiagramPluginId.ModelTrackingDiagramPlugin, DiagramPluginId.ConnectorHandlerDiagramPlugin, RoslynDiagramPluginId.ModelExtenderDiagramPlugin })); }
public ModelExtenderDiagramPlugin(IHostUiServices hostUiServices) { _hostUiServices = hostUiServices; }
public ApplicationUiServiceFactory(IHostUiServices hostUiServices, bool initialIsDescriptionVisible) { _hostUiServices = hostUiServices; _initialIsDescriptionVisible = initialIsDescriptionVisible; }
private static IVisualizationService CreateVisualizationService(IRoslynModelProvider roslynModelProvider, IHostUiServices hostUiServices) { return(new VisualizationService( new RoslynModelServiceFactory(roslynModelProvider), new RoslynDiagramServiceFactory(), new ApplicationUiServiceFactory(hostUiServices, AppDefaults.NodeDescriptionsVisibleByDefault), new ApplicationDiagramPluginFactory(new RoslynLayoutPriorityProvider(), new RoslynDiagramShapeFactory(), new VerticalNodeLayoutAlgorithm(), hostUiServices), new[] { DiagramPluginId.AutoLayoutDiagramPlugin, DiagramPluginId.ModelTrackingDiagramPlugin, DiagramPluginId.ConnectorHandlerDiagramPlugin, ApplicationDiagramPluginId.ModelExtenderDiagramPlugin })); }