public bool OpenWindow(WindowName windowName) { UIMedia createCommand = GetCreateCommand(windowName.Key); if (createCommand != null) { GComponent component = createCommand.Inject(); if (component != null) { if (lastWindow != null && lastWindowContent != null && lastDispose != null) { if (lastDispose.Disposable) { lastWindowContent.Dispose(); } } if (lastWindow == null) { lastWindow = new Window(); lastWindow.name = "ModalWindow"; lastWindow.modal = true; } lastDispose = component as UIMdeiaDispose; lastWindowContent = component; lastWindow.AddChild(component); lastWindow.Show(); return(true); } } return(false); }
public bool AddMainMenu(WindowName windowName) { UIMedia createCommand = GetCreateCommand(windowName.Key); if (createCommand != null) { GComponent component = createCommand.Inject(); if (component != null) { if (MainMenuWindow == null) { MainMenuWindow = new Window(); MainMenuWindow.name = "MainMenuWindow"; } MainMenuWindow.AddChild(component); MainMenuWindow.Show(); return(true); } } return(false); }