private void EndSave()
 {
     if (save)
     {
         UpdateStatus(this, new UpdateStatusEvent("Messung beendet"));
         save = false;
         //saveData.fixSampleRate();
         saveData.commitChanges();
         //Deletes the SaveData Object
         saveData = new SaveData(this);
         form1.ChangeSaveButtonText(true);
         form1.ChangeSaveImage();
     }
 }
        /// <summary>
        /// Starts Recording if Save Dialog confirmed
        /// </summary>
        /// <param name="name"></param>
        /// <param name="birthDate"></param>
        /// <param name="gender"></param>
        public void StartRecording(string name, DateTime birthDate, char gender)
        {
            string documents = Environment.GetFolderPath(Environment.SpecialFolder.Desktop);
            string subPath = Path.Combine("Messungen", name);
            string fileName = DateTime.Now.ToString("yyyy_MM_dd") + "_" + DateTime.Now.ToLongTimeString() + ".edf";
            subPath = Path.Combine(documents, subPath);
            fileName = fileName.Replace(':', '_');
            fileName = Path.Combine(subPath, fileName);
            if (!Directory.Exists(subPath)) Directory.CreateDirectory(subPath);

            saveData = new SaveData(1, fileName, Statics.complexSave,this);
            saveData.addInformation("test",Statics.sensorName,birthDate,gender,name);
            save = true;
            saveDialog.Dispose();
            form1.Enabled = true;
            form1.Focus();
            form1.ChangeSaveButtonText(false);
            form1.ChangeSaveImage();
            UpdateStatus(this, new UpdateStatusEvent("Messung gestartet"));
        }