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; }
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; }
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; }