Beispiel #1
0
        public static Viewport3D Make3D(ViewportBase viewport, Viewport3D.ViewType type)
        {
            Viewports.Remove(viewport);
            var pos = MainWindowGrid.GetCellPosition(viewport);
            MainWindowGrid.Controls.Remove(viewport);
            viewport.Dispose();

            viewport = Create3D(type);
            Viewports.Add(viewport);
            SubscribeExceptions(viewport);
            MainWindowGrid.Controls.Add(viewport, pos.Column, pos.Row);
            viewport.Run();
            return (Viewport3D) viewport;
        }
Beispiel #2
0
        public static Viewport3D Make3D(ViewportBase viewport, Viewport3D.ViewType type)
        {
            var parent = GetParentSplitControl(viewport);
            if (parent == null) return null;

            Viewports.Remove(viewport);

            var newViewport = Create3D(type);
            SubscribeExceptions(newViewport);

            parent.ReplaceControl(viewport, newViewport);

            Viewports.Add(newViewport);

            viewport.Dispose();
            newViewport.Run();

            return newViewport;
        }
Beispiel #3
0
        public static Viewport2D Make2D(ViewportBase viewport, Viewport2D.ViewDirection direction)
        {
            Viewports.Remove(viewport);
            var pos = MainWindowGrid.GetCellPosition(viewport);
            MainWindowGrid.Controls.Remove(viewport);
            viewport.Dispose();

            viewport = Create2D(direction);
            Viewports.Add(viewport);
            SubscribeExceptions(viewport);
            MainWindowGrid.Controls.Add(viewport, pos.Column, pos.Row);
            viewport.Run();
            return (Viewport2D) viewport;
        }