private void PresetSaveButton_Click(object sender, EventArgs e) { Preset preset = GetPresetFromForm(); string fileName = GetPresetFileName(preset); FileInfo fi = new FileInfo(fileName); if (!fi.Directory.Exists) { fi.Directory.Create(); } preset.SaveAs(fi.FullName); // Replace preset with same name. for (int i = 0; i < Presets.Count(); i++) { if (Presets[i].PresetName == preset.PresetName) { Presets[i] = preset; } } //PresetSaveButton.Image = GetImage("disk_gray_16x16"); PresetSaveButton.Enabled = false; }