public static void setInstance(Questions question)
 {
     CurrentQuestion.currentQuestion = question;
 }
 private void detach_Questions(Questions entity)
 {
     this.SendPropertyChanging("Questions");
     entity.QuestionSets = null;
 }
 partial void DeleteQuestions(Questions instance);
 partial void UpdateQuestions(Questions instance);
 partial void InsertQuestions(Questions instance);
        void pickFile()
        {
            Microsoft.Win32.OpenFileDialog openFileDialog = new Microsoft.Win32.OpenFileDialog();
            switch (CurrentQuestionSet.getInstance().Type)
            {
                case (int)Types.Music:
                    if (Settings.Default.defaultMusicFolder != String.Empty)
                        openFileDialog.InitialDirectory = Settings.Default.defaultMusicFolder;
                    openFileDialog.Filter = "Music Formats|" +
                        "*.mp3;*.ram;*.rm;*.wav;*.wma;*.mid;*.mp4|" +
                        "mp3 (*.mp3)|*.mp3|ram (*.ram)|*.ram|rm (*.rm)|*.rm|" +
                        "wav (*.wav)|*.wav|wma (*.wma)|*.wma|mid (*.mid)|*.mid|" +
                        "mp4 (*.mp4)|*.mp4";
                    break;
                case (int)Types.Screenshot:
                    if (Settings.Default.defaultScreenshotFolder != String.Empty)
                        openFileDialog.InitialDirectory = Settings.Default.defaultScreenshotFolder;
                    openFileDialog.Filter = "JPG files (*.jpg)|*.jpg|PNG files (*.png)|*.png|BMP files (*.bmp)|*.bmp";
                    break;
            }
            openFileDialog.Multiselect = false;

            if (openFileDialog.ShowDialog() ?? false)
            {
                Questions newQuestion = new Questions();
                newQuestion.Question = openFileDialog.FileName;
                newQuestion.Answer = "";

                App.db.Questions.InsertOnSubmit(newQuestion);
                App.db.SubmitChanges();

                saveQuestions();
                populateQuestionSetDataGrid();
            }
        }