Beispiel #1
0
        protected override async Task OnUncheckedAsync()
        {
            await HostUiService.ShowDiagramWindowAsync();

            DiagramWindowService.CollapseAllNodes();
            DiagramWindowService.KeepDiagramCentered();
        }
Beispiel #2
0
        public override async Task ExecuteAsync()
        {
            await HostUiService.ShowDiagramWindowAsync();

            DiagramWindowService.ExpandAllNodes();
            DiagramWindowService.KeepDiagramCentered();
        }
        protected async Task CreateAndProcessDiagramImageAsync(
            [NotNull] Action <BitmapSource> imageProcessingAction,
            [NotNull] string imageProcessingMessage)
        {
            // Using int.MaxValue for max progress because the real max value is not yet known.
            using (var progressDialog = await HostUiService.CreateProgressDialogAsync("Generating image..", int.MaxValue))
            {
                progressDialog.ShowProgressNumber = false;
                progressDialog.ShowWithDelay();

                try
                {
                    var bitmapSource = await DiagramWindowService.CreateDiagramImageAsync(
                        DiagramWindowService.ImageExportDpi.Value,
                        DiagramWindowService.ExportedImageMargin,
                        progressDialog.CancellationToken,
                        progressDialog.Progress,
                        progressDialog.MaxProgress);

                    progressDialog.Reset(imageProcessingMessage, showProgressNumber: false);
                    await Task.Factory.StartSTA(() => imageProcessingAction(bitmapSource), progressDialog.CancellationToken);
                }
                catch (OperationCanceledException)
                {
                }
                catch (OutOfMemoryException)
                {
                    HandleOutOfMemory();
                }
            }
        }
        public override async Task ExecuteAsync()
        {
            await ShowProgressAndUpdateModelAsync();

            await HostUiService.ShowDiagramWindowAsync();

            DiagramWindowService.ZoomToDiagram();
        }
Beispiel #5
0
        public override async Task ExecuteAsync()
        {
            await ShowProgressAndAddItemsAsync(_modelNodeIds);

            await HostUiService.ShowDiagramWindowAsync();

            if (_followWithViewport)
            {
                DiagramWindowService.FollowDiagramNodes(_modelNodeIds);
            }
        }
Beispiel #6
0
        public override async Task ExecuteAsync()
        {
            var maybeModelNode = await TryAddCurrentSymbolToDiagramAsync();

            if (!maybeModelNode.HasValue)
            {
                return;
            }

            await HostUiService.ShowDiagramWindowAsync();

            DiagramWindowService.FollowDiagramNode(maybeModelNode.Value.Id);
        }
Beispiel #7
0
        public override async Task ExecuteAsync()
        {
            var symbol = RoslynBasedModelService.GetSymbol(_diagramNode.ModelNode);

            if (await RoslynWorkspaceProvider.HasSourceAsync(symbol))
            {
                await RoslynWorkspaceProvider.ShowSourceAsync(symbol);
            }
            else
            {
                DiagramWindowService.ShowPopupMessage(NoSourceMessage, NoSourceMessageDuration);
            }
        }
Beispiel #8
0
        public override async Task ExecuteAsync()
        {
            var maybeModelNode = await TryAddCurrentSymbolToDiagramAsync();

            if (!maybeModelNode.HasValue)
            {
                return;
            }

            var addedNodeIds = await ExtendModelAndDiagramAsync(maybeModelNode.Value);

            if (!addedNodeIds.Any())
            {
                return;
            }

            await HostUiService.ShowDiagramWindowAsync();

            DiagramWindowService.FollowDiagramNodes(addedNodeIds);
        }
Beispiel #9
0
 public ShowHideNodeDescriptionsToggleCommand(IAppServices appServices)
     : base(appServices, initialIsChecked: AppDefaults.NodeDescriptionsVisibleByDefault)
 {
     DiagramWindowService.ExpandAllNodes();
 }
        public override async Task ExecuteAsync()
        {
            await HostUiService.ShowDiagramWindowAsync();

            DiagramWindowService.ZoomToDiagram();
        }