public void collectMapDetails(object sender, EditorMapEvent e) { currentFilename = ""; updateCanvas(e); mapDetails = e; createWindow.RaiseCreateMapEvent -= new EventHandler <EditorMapEvent>(collectMapDetails); createWindow = null; }
/* +==== Creating a new map ====+ */ /* Using the init new map button and the file/button tab to open the CreateMapWindow * Sends a custom EditorMapEvent that retrieves the map details from the CreateMapWindow * And removes it when the CreateMapWindow has been terminated (closed) * * Also, it removes the init buttons when the event was succesful. */ #region Creating a new Map private void btn_newMap_init_Click(object sender, RoutedEventArgs e) { if (createWindow == null) { createWindow = new CreateMapWindow(); createWindow.RaiseCreateMapEvent += new EventHandler <EditorMapEvent>(collectMapDetails); createWindow.Show(); } }