public static void Execute(DockItem dockItem) { DockControl dockControl = dockItem.DockControl; if (dockControl.CanEnterUndo) { dockControl.ExecuteCommand(new HideCommand(dockItem)); } else { dockItem.DoHide(); } }