Example #1
0
        }     //close method btnClose_App_Click()...

        /// <summary>
        /// this method is called whenever the user wants to export annotations...
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnExport_Click(object sender, RoutedEventArgs e)
        {
            int    userId   = User_Object.OVERALL_userID;
            string userName = User_Object.OVERALL_USER_NAME;
            //will suggest saving output to participant's most recent data folder
            //todo for some reason, calling User_Object below causes a problem
            //on some computers (try testing this more thoroughly)
            string suggestedPath = "";    // User_Object.get_likely_PC_destination_root(
            //userId, userName);

            //prompt researcher on where to store annotations
            SaveFileDialog saveFileDialog = new SaveFileDialog();

            saveFileDialog.InitialDirectory = suggestedPath;
            saveFileDialog.FileName         = userName + ".csv";
            saveFileDialog.ShowDialog();
            if (!saveFileDialog.FileName.Equals(""))
            {
                //save annotations for this day to file
                string fileName = saveFileDialog.FileName;
                Daily_Annotation_Summary.writeAllAnnotationsToCsv(userId,
                                                                  fileName);
                Record_User_Interactions.log_interaction_to_database(
                    "Window1_btnExport_Click", fileName);
            }
        }     //close method btnExport_Click()...