示例#1
0
        public void ShowInNewWindow()
        {
            var source = CurrentDisplay ?? this.Display1;

            if (source == null)
            {
                return;
            }

            var graph   = source.Data.Graph;
            var focused = source.Data.Focused;

            IVidget vidget  = null;
            Action  onClose = null;

            if (graph != null && focused != null)
            {
                using (var contentViewManager = Registry.Create <IContentViewManager> ()) {
                    contentViewManager.IsProviderOwner = false;
                    if (contentViewManager.IsContent(graph, focused))
                    {
                        // TODO: get viewer, make a new instance of it, get the backend
                        // if sheetviewer, use display(see down) as Viewer
                    }
                }
            }
            // TODO: see above; for now we take always a VisualsDisplay
            {
                var display = new VisualsDisplay();
                onClose += () => Mesh.RemoveDisplay(display);

                Mesh.CopyDisplayProperties(source, display);
                display.Data = Mesh.CreateSinkScene(graph);

                Mesh.AddDisplay(display);
                vidget = display;
            }

            Backend.ViewInWindow(vidget, onClose);
        }