/// <summary>
        /// Handle a button click from the wrap panel.
        /// </summary>
        /// <param name="sender">Event sender</param>
        /// <param name="e">Event arguments</param>
        private void ButtonClick(object sender, RoutedEventArgs e)
        {
            var            button         = (Button)e.OriginalSource;
            SampleDataItem sampleDataItem = button.DataContext as SampleDataItem;

            if (sampleDataItem != null && sampleDataItem.NavigationPage != null)
            {
                backButton.Visibility    = System.Windows.Visibility.Visible;
                navigationRegion.Content = Activator.CreateInstance(sampleDataItem.NavigationPage);
            }
            else
            {
                var selectionDisplay = new SelectionDisplay(button.Content as string);
                this.kinectRegionGrid.Children.Add(selectionDisplay);

                // Selection dialog covers the entire interact-able area, so the current press interaction
                // should be completed. Otherwise hover capture will allow the button to be clicked again within
                // the same interaction (even whilst no longer visible).
                selectionDisplay.Focus();

                // Since the selection dialog covers the entire interact-able area, we should also complete
                // the current interaction of all other pointers.  This prevents other users interacting with elements
                // that are no longer visible.
                this.kinectRegion.InputPointerManager.CompleteGestures();

                e.Handled = true;
            }
        }
        private void TrainingItemButtonClick(object sender, RoutedEventArgs e)
        {
            var button = (Button)e.OriginalSource;
            TrainingDataItem trainingDataItem = button.DataContext as TrainingDataItem;

            if (trainingDataItem != null && trainingDataItem.NavigationPage != null)
            {
                trainingNavigationRegion.Content = Activator.CreateInstance(trainingDataItem.NavigationPage);
            }
            else
            {
                var selectionDisplay = new SelectionDisplay(button.Content as string);
                this.trainingRegionGrid.Children.Add(selectionDisplay);

                // Selection dialog covers the entire interact-able area, so the current press interaction
                // should be completed. Otherwise hover capture will allow the button to be clicked again within
                // the same interaction (even whilst no longer visible).
                selectionDisplay.Focus();

                // Since the selection dialog covers the entire interact-able area, we should also complete
                // the current interaction of all other pointers.  This prevents other users interacting with elements
                // that are no longer visible.

                e.Handled = true;
            }
        }
        /// <summary>
        /// Handle a button click from the wrap panel.
        /// </summary>
        /// <param name="sender">Event sender</param>
        /// <param name="e">Event arguments</param>
        private void KinectTileButtonClick(object sender, RoutedEventArgs e)
        {
            var button           = (KinectTileButton)e.OriginalSource;
            var selectionDisplay = new SelectionDisplay(button.Label as string);

            this.kinectRegionGrid.Children.Add(selectionDisplay);
            e.Handled      = true;
            this.IsEnabled = false;
            string buttonLabel  = (string)button.Label;
            int    postureIndex = 0;

            if (buttonLabel == "1")
            {
                postureIndex = 1;
            }
            else if (buttonLabel == "2")
            {
                postureIndex = 2;
            }


            if (postureIndex < 0)
            {
                return;
            }

            temp = new KinectExplorer.MainWindow(postureIndex);
            temp.OnChildReturnEventInMainWindow += new KinectExplorer.MainWindow.OnChildClosedForReturnValueInMainWindow(OnChildReturnEvent);
            temp.Closed += WindowClosedForMachineCheck;



            temp.Show();
        }
        /// <summary>
        /// Handle a button click from the wrap panel.
        /// </summary>
        /// <param name="sender">Event sender</param>
        /// <param name="e">Event arguments</param>
        private void KinectTileButtonClick(object sender, RoutedEventArgs e)
        {
            var button           = (KinectTileButton)e.OriginalSource;
            var selectionDisplay = new SelectionDisplay(button.Label as string, ref port);

            this.kinectRegionGrid.Children.Add(selectionDisplay);
            e.Handled = true;
        }
Beispiel #5
0
        /// <summary>
        /// Handle a button click from the wrap panel.
        /// </summary>
        /// <param name="sender">Event sender</param>
        /// <param name="e">Event arguments</param>
        private void KinectTileButtonClick(object sender, RoutedEventArgs e)
        {
            var button           = (KinectTileButton)e.OriginalSource;
            var selectionDisplay = new SelectionDisplay(button.Label as string);

            selectionDisplay.grid.Background = button.Background;
            selectionDisplay.Height          = 900;
            selectionDisplay.Width           = 600;
            this.kinectRegionGrid.Children.Add(selectionDisplay);
            e.Handled = true;
        }
        /// <summary>
        /// Handle a button click from the wrap panel.
        /// </summary>
        /// <param name="sender">Event sender</param>
        /// <param name="e">Event arguments</param>
        private void KinectTileButtonClick(object sender, RoutedEventArgs e)
        {
            var button           = (KinectTileButton)e.OriginalSource;
            var selectionDisplay = new SelectionDisplay(button.Label as string);

            this.kinectRegionGrid.Children.Add(selectionDisplay);
            e.Handled = true;

            glove.ActivateMotor(centro, valuesON);
            myTimer.Elapsed += new ElapsedEventHandler(ApagarMotorCentral);
            myTimer.Interval = 300;
            myTimer.Start();
        }
Beispiel #7
0
 /// <summary>
 /// Handle a button click from the wrap panel.
 /// </summary>
 /// <param name="sender">Event sender</param>
 /// <param name="e">Event arguments</param>
 private void KinectTileButtonClick(object sender, RoutedEventArgs e)
 {
     var button = (KinectTileButton)e.OriginalSource;
     var selectionDisplay = new SelectionDisplay(button.Label as string);
     //this.contentGrid.Children.Clear();
     this.contentGrid.Children.Add(selectionDisplay);
     //this.kinectRegionGrid.Children.Add(selectionDisplay);
     e.Handled = true;
 }
Beispiel #8
0
        /// <summary>
        /// Handle a button click from the wrap panel.
        /// </summary>
        /// <param name="sender">Event sender</param>
        /// <param name="e">Event arguments</param>
        private void KinectTileButtonClick(object sender, RoutedEventArgs e)
        {
            var button = (KinectTileButton)e.OriginalSource;

            //Check if this is a file
               if (File.Exists(path + button.Label.ToString()))
            {
                //This is a file

                // Clear out placeholder content
                this.wrapPanel.Children.Clear();

                //var selectionDisplay = new SelectionDisplay(button.Label as string);
                selectionDisplay = new SelectionDisplay();
                selectionDisplay.printMessage(button.Label as string, "This is a file.");

                this.kinectRegionGrid.Children.Add(selectionDisplay);

               //Add the files
                addFiles(path);
            }
            else
            {
               //Add the path with the new directory
                path += button.Label.ToString();

                // Clear out placeholder content
                this.wrapPanel.Children.Clear();
                Console.WriteLine(path);
                //This is a directory
                //Add the files in the selected directory
                if (!path.Equals("NOT FOUND"))

                    addFiles(path);
            }

            e.Handled = true;
        }
 /// <summary>
 /// Handle a button click from the wrap panel.
 /// </summary>
 /// <param name="sender">Event sender</param>
 /// <param name="e">Event arguments</param>
 private void KinectTileButtonClick(object sender, RoutedEventArgs e)
 {
     var button = (KinectTileButton)e.OriginalSource;
     var selectionDisplay = new SelectionDisplay(button.Label as string);
     this.kinectRegionGrid.Children.Add(selectionDisplay);
     e.Handled = true;
     glove.ActivateMotor(positivePins, valuesMax);
     Timer = new System.Timers.Timer() { Interval = 200 };
     Timer.Elapsed += DeactivateVibration;
     Timer.Enabled = true;
 }
Beispiel #10
0
        /// <summary>
        /// Handle a button click from the wrap panel.
        /// </summary>
        /// <param name="sender">Event sender</param>
        /// <param name="e">Event arguments</param>
        private void ButtonClick(object sender, RoutedEventArgs e)
        {
            UIInvoked();
            var      button   = (Button)e.OriginalSource;
            DataBase dataBase = button.DataContext as DataBase;

            if (dataBase != null)
            {
                if (dataBase.Title == "Видео")
                {
                    CreateData.Instance.GetAllVideos();
                }
                else if (dataBase.Title == "Игры")
                {
                    CreateData.Instance.GetGames();
                }
                else if (dataBase.Title == "Расписание")
                {
                    CreateData.Instance.GetAllTimetable();
                }

                if (dataBase is DataPageBase)
                {
                    DataPageBase dataPageBase = (DataPageBase)dataBase;

                    if (dataPageBase.NavigationPage != null)
                    {
                        history.Add(dataPageBase.UniqueId);
                        backButton.Visibility    = Visibility.Visible;
                        navigationRegion.Content = Activator.CreateInstance(dataPageBase.NavigationPage, dataPageBase.Parametrs);
                    }
                }
                if (dataBase is DataGroupBase)
                {
                    DataGroupBase dataGroupBase = (DataGroupBase)dataBase;

                    if (dataGroupBase.NewGroup != null)
                    {
                        history.Add(dataGroupBase.NewGroup);
                        backButton.Visibility = Visibility.Visible;
                        scrollViewer.VerticalScrollBarVisibility = ScrollBarVisibility.Disabled;
                        var type = DataSource.GetGroup(dataGroupBase.NewGroup).TypeGroup;
                        itemsControl.ItemTemplate = (DataTemplate)FindResource(type + "Template");
                        itemsControl.ItemsSource  = DataSource.GetGroup(dataGroupBase.NewGroup);
                    }
                }
                if (dataBase is DataExecuteBase)
                {
                    DataExecuteBase dataExecuteBase = (DataExecuteBase)dataBase;

                    if (dataExecuteBase.Parametrs != null)
                    {
                        Process.Start(dataExecuteBase.Parametrs[0]);

                        ButtonAutomationPeer peer       = new ButtonAutomationPeer(backButton);
                        IInvokeProvider      invokeProv = peer.GetPattern(PatternInterface.Invoke) as IInvokeProvider;
                        invokeProv.Invoke();
                    }
                }
            }
            else
            {
                var selectionDisplay = new SelectionDisplay(button.Content as string);
                this.kinectRegionGrid.Children.Add(selectionDisplay);

                // Selection dialog covers the entire interact-able area, so the current press interaction
                // should be completed. Otherwise hover capture will allow the button to be clicked again within
                // the same interaction (even whilst no longer visible).
                selectionDisplay.Focus();

                // Since the selection dialog covers the entire interact-able area, we should also complete
                // the current interaction of all other pointers.  This prevents other users interacting with elements
                // that are no longer visible.
                this.kinectRegion.InputPointerManager.CompleteGestures();

                e.Handled = true;
            }
        }