public static View MaximizePrepare(EditorWindow win)
{
View parent = win.m_Parent.parent;
View view = parent;
while (parent != null && parent is SplitView)
{
view = parent;
parent = parent.parent;
}
DockArea dockArea = win.m_Parent as DockArea;
if (dockArea == null)
{
return(null);
}
if (parent == null)
{
return(null);
}
MainWindow x = view.parent as MainWindow;
if (x == null)
{
return(null);
}
ContainerWindow window = win.m_Parent.window;
if (window == null)
{
return(null);
}
int num = dockArea.m_Panes.IndexOf(win);
if (num == -1)
{
return(null);
}
dockArea.selected = num;
WindowLayout.SaveSplitViewAndChildren(view, win, Path.Combine(WindowLayout.layoutsProjectPath, "CurrentMaximizeLayout.dwlt"));
dockArea.actualView = null;
dockArea.m_Panes[num] = null;
MaximizedHostView maximizedHostView = ScriptableObject.CreateInstance <MaximizedHostView>();
int idx = parent.IndexOfChild(view);
Rect position = view.position;
parent.RemoveChild(view);
parent.AddChild(maximizedHostView, idx);
maximizedHostView.actualView = win;
maximizedHostView.position = position;
return(view);
}