Inheritance: INotifyPropertyChanged
Ejemplo n.º 1
0
        /// <summary>
        /// Default constructor.
        /// </summary>
        public SurfaceWindow1()
        {
            InitializeComponent();

            InitSpeechRecognition();

            MotionTrackingClient = new MotionTrackingClient(this);

            NativeTouchDevice.RegisterEvents(this);

            this.DataContext = this;
        }
Ejemplo n.º 2
0
        public SurfaceWindow1(bool isHorizontal)
        {
            InitializeComponent();

            this.Loaded += new RoutedEventHandler(SurfaceWindow1_Loaded);

            MotionTrackingClient = new MotionTrackingClient(this);

            NativeTouchDevice.RegisterEvents(this);

            InitData();
            this.DataContext = this;

            _gravityTimer = new DispatcherTimer();
            _gravityTimer.Tick += GetGavityOn;
            _gravityTimer.Interval = TimeSpan.FromSeconds(1.0 / 5.0);
        }
Ejemplo n.º 3
0
        public SurfaceWindow1(bool isHorizontal)
        {
            InitializeComponent();

            //this.WindowState = System.Windows.WindowState.Normal;
            //this.Width = 800;
            //this.Height = 400;
            //this.Left = 400;
            //this.Top = 0;
            //this.IsHorizontal = isHorizontal;
            this.Loaded += new RoutedEventHandler(SurfaceWindow1_Loaded);

            MotionTrackingClient = new MotionTrackingClient(this);
            MotionTrackingClient.FrameUpdated += new EventHandler<FrameUpdatedEventArgs>(MotionTrackingClient_FrameUpdated);
            NativeTouchDevice.RegisterEvents(this);

            InitData();
            this.DataContext = this;
        }
Ejemplo n.º 4
0
 internal static void UnregisterEvents(MotionTrackingClient client)
 {
     bool isClientsEmpty = false;
     lock (clients)
     {
         if (clients.Contains(client))
         {
             clients.Remove(client);
         }
         isClientsEmpty = clients.Count == 0;
     }
     if (isClientsEmpty)
     {
         HandPointGenerator.Default.StopGenerating();
     }
 }
Ejemplo n.º 5
0
        internal static void RegisterEvents(MotionTrackingClient client)
        {
            if (client == null)
                throw new ArgumentNullException("client");

            bool isFirstClient = false;
            lock (clients)
            {
                if (clients.Count == 0)
                    isFirstClient = true;
                clients.Add(client);
            }

            if (isFirstClient)
            {
                HandPointGenerator.Default.StartGenerating();
            }
        }