private void FileOpen_Click(object sender, EventArgs e) { if (!CanOverwrite()) { return; } var file = new OpenFileDialog() { AddExtension = true, DefaultExt = "sbdn", CheckFileExists = true, InitialDirectory = SoundBoardData.GetDefaultSaveDirectory().FullName }; if (file.ShowDialog() == DialogResult.Cancel) { return; } SavePath = file.FileName; SoundBoardData.Load(SavePath); foreach (var item in Buttons) { item.Data.Reset(); item.Data = SoundBoardData.AllData.Data[item.Data.Index]; item.Update(); } HasChanged = false; }
private void SaveButton_Click(object sender, EventArgs e) { foreach (var recorder in Form1.Recorders) { recorder.Reset(); } SoundBoardData.SaveProperties(); Close(); }
public Form1() { KeyPreview = true; SoundBoardData.LoadProperties(); InitializeComponent(); var r = new AudioRecorder(0); Recorders.Add(r); r.StartRecording(); //SoundButtonMaker.Engine = Engine; }
private bool Save() { if (SavePath == String.Empty) { if (!ChooseSavePath()) { return(false); } } SoundBoardData.Save(SavePath); HasChanged = false; return(true); }
public static void Load(string filePath) { FileStream stream = new FileStream(filePath, FileMode.Open); _allData = (SoundBoardData)_formater.Deserialize(stream); }
private bool ChooseSavePath() { var save = new SaveFileDialog() { AddExtension = true, DefaultExt = "sbdn", OverwritePrompt = true, InitialDirectory = SoundBoardData.GetDefaultSaveDirectory().FullName, Filter = "SoundBoard files (*.sbdn)|*.sbdn;*.SBDN" }; if (save.ShowDialog() == DialogResult.Cancel) { return(false); } SavePath = save.FileName; return(true); }