void MnExportConfigClick(object sender, EventArgs e) { string filename = null; using (System.Windows.Forms.SaveFileDialog ofd = new SaveFileDialog()) { ofd.Filter = "GCODE Files|*.nc"; ofd.AddExtension = true; ofd.RestoreDirectory = true; if (ofd.ShowDialog() == System.Windows.Forms.DialogResult.OK) { filename = ofd.FileName; } } if (filename != null) { Core.ExportConfig(filename); } }