void CloseWindow(object sender) { Components.Remove((WindowBase)sender); if (sender == fileBrowser) { fileBrowser = null; } sender = null; }
FileWindowsBase ShowFileBrowser() { if (fileBrowser == null) { fileBrowser = new FileWindowsBase(this, new Rectangle(windowSp.X, windowSp.Y, 600, 500), "Fonts/Airel12", "File Browser"); fileBrowser.CurrentFolder = "C:\\";//@"C:\Development\MonoGame\Randomchaos_MonoGame_Samples\RandomchaosMG\Sandboxs\RandomchaosMGUIBaseSandBox\Content\"; fileBrowser.OnCloseWindowEvent += CloseWindow; fileBrowser.Initialize(); fileBrowser.Visible = false; return(fileBrowser); } return(null); }