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