private void Save_Click(object sender, EventArgs e) { using (SaveFileDialog sfd = new SaveFileDialog()) { sfd.AddExtension = true; sfd.OverwritePrompt = true; sfd.CheckPathExists = true; sfd.Filter = "ILPatcher File | *.ilp"; if (sfd.ShowDialog() != DialogResult.OK) { return; } NameCompressor.Compress = false; XmlDocument xDoc = new XmlDocument(); dataStruct.Save(xDoc); XMLUtility.SaveToFile(xDoc, sfd.FileName); } }