private void textChanged()
 {
     filenames.Rows[0][0] = txtOutputFolder.Text;
     filenames.Rows[0][1] = txtSampleName.Text;
     filenames.WriteXml(settingsFile);
     if (OutputFilenameChanged != null)
     {
         OutputFileNameChangedEventArgs evt = new OutputFileNameChangedEventArgs();
         evt.filename        = txtSampleName.Text;
         evt.outputDirectory = txtOutputFolder.Text;
         OutputFilenameChanged(this, evt);
     }
 }
        /**
         * subscribe to changes in data filename
         * */
        public void userfilenameChanged(object sender, OutputFileNameChangedEventArgs evt)
        {
            profileFilename = evt.outputDirectory + evt.filename;


            DateTime dt      = DateTime.Now;
            string   dateStr = dt.ToString("yyyyMMdd");

            string path     = Directory.GetParent(profileFilename).FullName;
            string mainName = Path.GetFileName(profileFilename);


            for (int i = 0; i < 1000; i++)
            {
                string t = path + "\\" + dateStr + mainName + "_" + "_" + i.ToString();

                if (!File.Exists(t + "_T_profile.txt"))
                {
                    profileFilename = t + "_T_profile.txt";
                    break;
                }
            }
        }
 public void userfilenameChanged(object sender, OutputFileNameChangedEventArgs evt)
 {
     userFilename = evt.outputDirectory + evt.filename;
     initializeDataSaver();
 }