/// <summary> /// Save menu item event handler /// </summary> /// <summary xml:lang="ru"> /// Обработчик события нажатия пункта меню "Сохранить..." /// </summary> /// <param name="sender">Component that emitted the event</param> /// <param name="e">Event arguments</param> /// <param name="sender" xml:lang="ru">Указатель на компонент, который отправил событие</param> /// <param name="e" xml:lang="ru">Аргументы события</param> private void saveToolStripMenuItem_Click(object sender, System.EventArgs e) { try { CurrentFile.SaveFile(); } catch (Exception exception) { MessageBox.Show(exception.Message); } }
private void OnCreateGxtClick(object sender, EventArgs e) { SaveFileDialog dialog = new SaveFileDialog(); dialog.FileName = ""; dialog.Filter = "GXT file (*.gxt)|*.gxt|FXT file (*.fxt)|*.fxt"; dialog.FilterIndex = 2; dialog.Title = "Save as..."; DialogResult result = dialog.ShowDialog(); switch (result) { case DialogResult.OK: GameFile file = new GameFile(dialog.FileName); switch (file.Extension) { case ".fxt": FXTFile fxtFile = new FXTFile(file.FullPath); FXTEditorWindow fxtEditorWindow = new FXTEditorWindow(); try { fxtFile.SaveFile(); } catch (Exception ex) { MessageBox.Show(ex.Message); } fxtEditorWindow.OpenFile(fxtFile); fxtEditorWindow.Show(); break; case ".gxt": break; default: MessageBox.Show("Unknown file extention!"); break; } break; default: break; } }