Example #1
0
        public MotionTest()
        {
            timer = new DispatcherTimer();  //creates a DispatcherTimer to handle event triggers
            timer.Interval = TimeSpan.FromMilliseconds(30); //triggers every 30 milliseconds
            timer.Tick += new EventHandler(timer_Tick);

            movement_time = new DispatcherTimer();
            movement_time.Interval = TimeSpan.FromSeconds(1);
            movement_time.Tick += new EventHandler(movement_time_Tick);

            motionDB = new DatabaseContext(DatabaseContext.Database_Connection);    //creates a link to the database
            this.DataContext = this;

            InitializeComponent();
        }
Example #2
0
        public CognitivTest()
        {
            _current_input = 0;
            combination = new int[4];
            user_input = new int[4];
            rand = new Random();
            timer = DateTime.Now;
            time_start = new TimeSpan(0, 0, 0);

            for (int i = 0; i < MAX_INPUT; i++)
            {
                combination[i] = rand.Next(4) ;
            }

            InitializeComponent();
            cognitiveDB = new DatabaseContext(DatabaseContext.Database_Connection);
            this.DataContext = this;
        }
Example #3
0
        public Mathproblem()
        {
            mathProblems = new string[10];
            mathSolutions = new string[10];
            randomNumber = new Random();
            problemNumber = randomNumber.Next(10);

            //here i set the specified array index from random problemNumber to be a placeholder question
            //in a better version this would get its data directly from the database
            mathProblems[problemNumber] = "1+1";
            mathSolutions[problemNumber] = "2";

            InitializeComponent();

            mathDB = new DatabaseContext(DatabaseContext.Database_Connection); //creates a connection to the database
            this.DataContext = this;

            displayProblem();
            this.Loaded += new RoutedEventHandler(Mathproblem_Loaded); //creates an event handler for when the page is finished loading
        }
Example #4
0
        /// <summary>
        /// Constructor for the Application object.
        /// </summary>
        public App()
        {
            // Global handler for uncaught exceptions.
            UnhandledException += Application_UnhandledException;

            // Standard Silverlight initialization
            InitializeComponent();

            // Phone-specific initialization
            InitializePhoneApplication();

            // Show graphics profiling information while debugging.
            if (System.Diagnostics.Debugger.IsAttached)
            {
                // Display the current frame rate counters.
                Application.Current.Host.Settings.EnableFrameRateCounter = true;

                // Show the areas of the app that are being redrawn in each frame.
                //Application.Current.Host.Settings.EnableRedrawRegions = true;

                // Enable non-production analysis visualization mode,
                // which shows areas of a page that are handed off to GPU with a colored overlay.
                //Application.Current.Host.Settings.EnableCacheVisualization = true;

                // Disable the application idle detection by setting the UserIdleDetectionMode property of the
                // application's PhoneApplicationService object to Disabled.
                // Caution:- Use this under debug mode only. Application that disables user idle detection will continue to run
                // and consume battery power when the user is not using the phone.
                PhoneApplicationService.Current.UserIdleDetectionMode = IdleDetectionMode.Disabled;
            }

            using (DatabaseContext db = new DatabaseContext(DatabaseContext.Database_Connection))
            {
                if (db.DatabaseExists() == false)
                {
                    db.CreateDatabase();
                }
            }
        }