Beispiel #1
0
        public MainWindow()
        {
            this.InitializeComponent();
            //for viewer animation effect
            animatedViewer = new AnimatedViewer(this);
            //for changing pages
            viewControlHelper = ViewControlHelper.Instance;
            VoiceControlHelper.Initialize();   //initailize voice control
            //for gesture control
            GestureControlHelper.Initialize(); //initailize gesture control
            backgroundWorker1 = new BackgroundWorker();
            backgroundWorker1.WorkerReportsProgress      = true;
            backgroundWorker1.WorkerSupportsCancellation = true;
            backgroundWorker1.DoWork             += new DoWorkEventHandler(this.backgroundWorker1_DoWork);
            backgroundWorker1.ProgressChanged    += new ProgressChangedEventHandler(this.backgroundWorker1_ProgressChanged);
            backgroundWorker1.RunWorkerCompleted += new RunWorkerCompletedEventHandler(this.backgroundWorker1_RunWorkerCompleted);
            backgroundWorker1.RunWorkerAsync();
            backgroundWorker2 = new BackgroundWorker();
            backgroundWorker2.WorkerReportsProgress      = true;
            backgroundWorker2.WorkerSupportsCancellation = true;
            backgroundWorker2.DoWork             += new DoWorkEventHandler(this.backgroundWorker2_DoWork);
            backgroundWorker2.ProgressChanged    += new ProgressChangedEventHandler(this.backgroundWorker2_ProgressChanged);
            backgroundWorker2.RunWorkerCompleted += new RunWorkerCompletedEventHandler(this.backgroundWorker2_RunWorkerCompleted);
            //backgroundWorker2 is after backgroundWorker1

            hitResultsList     = new List <DependencyObject>();
            opennesThreadshold = 20;
            needDebouncing     = false;
            hoveredButton      = null;
            hoveredInkCanvas   = null;
            debouncingTimer    = null;
            inkCanvasMouseDown = false;
            bgwk1Running       = false; //needed since backgroundWorker1.IsBusy is always true, might need further investigation
            bgwk2Running       = false; //needed since backgroundWorker2.IsBusy is always true, might need further investigation
        }
Beispiel #2
0
        private void Page_Loaded(object sender, RoutedEventArgs e)
        {
            //set viewControlHelper after page is loaded into main window
            Window parentWindow = Window.GetWindow(this);

            viewControlHelper = ViewControlHelper.Instance;
            VoiceControlHelper.voiceControlEnabled = true;
        }
Beispiel #3
0
 public static void Initialize()
 {
     viewControlHelper   = ViewControlHelper.Instance;
     detectedVoiceParams = new MyVoiceParams();
     keywordDetected     = false;
     voiceControlEnabled = false;
     toSearch            = false;
     commandSentence     = "";
     parentWindow        = App.Current.MainWindow;
 }
Beispiel #4
0
 private void ResultPage_Loaded(object sender, RoutedEventArgs e)
 {
     viewControlHelper      = ViewControlHelper.Instance;
     ResultNameTextBox.Text = MatchingHelper.matchedClass;
     backgroundWorkerBing   = new BackgroundWorker();
     backgroundWorkerBing.WorkerReportsProgress      = true;
     backgroundWorkerBing.WorkerSupportsCancellation = true;
     backgroundWorkerBing.DoWork             += new DoWorkEventHandler(this.backgroundWorkerBing_DoWork);
     backgroundWorkerBing.ProgressChanged    += new ProgressChangedEventHandler(this.backgroundWorkerBing_ProgressChanged);
     backgroundWorkerBing.RunWorkerCompleted += new RunWorkerCompletedEventHandler(this.backgroundWorkerBing_RunWorkerCompleted);
     backgroundWorkerBing.RunWorkerAsync();
 }
Beispiel #5
0
 private void Page_Loaded(object sender, RoutedEventArgs e)
 {
     //set viewControlHelper after page is loaded into main window
     parentWindow          = Window.GetWindow(this);
     textBox               = (TextBox)parentWindow.FindName("eventBox");
     viewControlHelper     = ViewControlHelper.Instance;
     backgroundWorkerMatch = new AbortableBackgroundWorker();
     backgroundWorkerMatch.WorkerReportsProgress      = true;
     backgroundWorkerMatch.WorkerSupportsCancellation = true;
     backgroundWorkerMatch.DoWork             += new DoWorkEventHandler(this.backgroundWorkerMatch_DoWork);
     backgroundWorkerMatch.ProgressChanged    += new ProgressChangedEventHandler(this.backgroundWorkerMatch_ProgressChanged);
     backgroundWorkerMatch.RunWorkerCompleted += new RunWorkerCompletedEventHandler(this.backgroundWorkerMatch_RunWorkerCompleted);
 }
Beispiel #6
0
        public static void Initialize()
        {
            viewControlHelper  = ViewControlHelper.Instance;
            geoNodeParams      = new MyGestureParams();
            myPath             = new MyGesturePath(oldPoint, newPoint);
            needDebouncing     = false;
            inkCanvasMouseDown = false;
            debouncingTimer    = null;
            hoveredButton      = null;
            hoveredInkCanvas   = null;

            parentWindow     = App.Current.MainWindow;
            XLabel           = (Label)parentWindow.FindName("XLabel");
            YLabel           = (Label)parentWindow.FindName("YLabel");
            hand_palm        = (Image)parentWindow.FindName("hand_palm");
            hand_grip        = (Image)parentWindow.FindName("hand_grip");
            testLabel        = (Label)parentWindow.FindName("testLabel");
            currentPageLabel = (Label)parentWindow.FindName("currentPageLabel");
            debouncingLabel  = (Label)parentWindow.FindName("debouncingLabel");
            eventBox         = (TextBox)parentWindow.FindName("eventBox");
            newPoint         = new Point();
            oldPoint         = new Point(-1, -1);
        }