private void mnuOpenProject_Click(object sender, EventArgs e) { OpenFileDialog ofd = new OpenFileDialog(); FileTypeCollection <Map> ftc = FileTypeManagerCache.GetFileTypeCollection <Map>(FileTypeFlags.ReadSupport); ofd.Filter = ftc.GetFileTypesFilter(false); if (ofd.ShowDialog() == true) { LoadProject(ofd.FileName); } }
private void mnuOpenProject_Click(object sender, EventArgs e) { using (OpenFileDialog ofd = new OpenFileDialog()) { FileTypeCollection <Map> ftc = FileTypeManagerCache.GetFileTypeCollection <Map>(FileTypeFlags.ReadSupport); ofd.Filter = ftc.GetFileTypesFilter(false); if (ofd.ShowDialog() == System.Windows.Forms.DialogResult.OK) { LoadProject(ofd.FileName); } } }