コード例 #1
0
        private void studyDisplay_SelectedIndexChanged(object sender, EventArgs e)
        {
            Console.WriteLine(studyDisplay.SelectedIndex);
            if (studyDisplay.SelectedIndex == -1)
            {
                studyDisplay.ClearSelected();
            }
            else
            {
                currentStudy = database.GetStudies()[studyDisplay.SelectedIndex];
                Console.WriteLine(currentStudy.ToString());

                // Refresh the data windows
                subjectDisplay.DataSource = database.GetSubjects(currentStudy);
                ((CurrencyManager)subjectDisplay.BindingContext[subjectDisplay.DataSource]).Refresh();
                subjectDisplay.ClearSelected();

                sessionDisplay.DataSource = blankList;
                ((CurrencyManager)sessionDisplay.BindingContext[sessionDisplay.DataSource]).Refresh();
                //sessionDisplay.DataSource = null;
                //sessionDisplay.DataSource = currentSubject.sessions;
                //sessionDisplay.ClearSelected();

                trialDisplay.DataSource = blankList;
                ((CurrencyManager)trialDisplay.BindingContext[trialDisplay.DataSource]).Refresh();
                //trialDisplay.DataSource = null;
                //trialDisplay.DataSource = currentSession.trials;
                //trialDisplay.ClearSelected();
            }
        }
コード例 #2
0
        public MainInterface()
        {
            InitializeComponent();
            database = new DatabaseControl();
            bw.WorkerSupportsCancellation = true;
            bw.WorkerReportsProgress      = true;

            blankList = new List <bool>();

            //studies = database.Load();
            currentStudy            = new Study();
            studyDisplay.DataSource = database.GetStudies();

            currentSubject = new Subject();
            //subjectDisplay.DataSource = currentStudy.subjects;

            currentSession = new Session();
            //sessionDisplay.DataSource = currentSubject.sessions;

            currentTrial = new Trial();
            //trialDisplay.DataSource = currentSession.trials;

            radiusSettings.SelectedIndex = 1;

            this.Refresh();
        }
コード例 #3
0
        public MainInterface()
        {
            InitializeComponent();
            database = new DatabaseControl();
            bw.WorkerSupportsCancellation = true;
            bw.WorkerReportsProgress = true;

            blankList = new List<bool>();

            //studies = database.Load();
            currentStudy = new Study();
            studyDisplay.DataSource = database.GetStudies();

            currentSubject = new Subject();
            //subjectDisplay.DataSource = currentStudy.subjects;

            currentSession = new Session();
            //sessionDisplay.DataSource = currentSubject.sessions;

            currentTrial = new Trial();
            //trialDisplay.DataSource = currentSession.trials;

            radiusSettings.SelectedIndex = 1;

            this.Refresh();
        }