当前位置: 首页>>代码示例>>C#>>正文


C# StatusChangedEventArgs类代码示例

本文整理汇总了C#中StatusChangedEventArgs的典型用法代码示例。如果您正苦于以下问题:C# StatusChangedEventArgs类的具体用法?C# StatusChangedEventArgs怎么用?C# StatusChangedEventArgs使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


StatusChangedEventArgs类属于命名空间,在下文中一共展示了StatusChangedEventArgs类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: KinectSensors_StatusChanged

        private void KinectSensors_StatusChanged(object sender, StatusChangedEventArgs e)
        {
            switch (e.Status)
            {
                case KinectStatus.Connected:
                    if (this.Kinect == null)
                    {
                        this.Kinect = e.Sensor;
                    }
                    break;

                case KinectStatus.Disconnected:
                    if (this.Kinect == e.Sensor)
                    {
                        this.Kinect = null;
                        this.Kinect = KinectSensor.KinectSensors
                                      .FirstOrDefault(x => x.Status == KinectStatus.Connected);

                        if (this.Kinect == null)
                        {
                            MessageBox.Show("This application requires a Kinect sensor");
                            this.Close();
                        }
                    }
                    break;

                //Handle all other statuses according to needs 
            }
        }
开发者ID:Kazhunter,项目名称:Kinect,代码行数:29,代码来源:MainWindow.xaml.cs

示例2: KinectSensors_StatusChanged

        private void KinectSensors_StatusChanged(object sender, StatusChangedEventArgs e)
        {
            switch (e.Status)
            {
                case KinectStatus.Connected:
                    if (this.Kinect == null)
                    {
                        this.Kinect = e.Sensor;
                    }
                    break;

                case KinectStatus.Disconnected:
                    if (this.Kinect == e.Sensor)
                    {
                        this.Kinect = null;
                        this.Kinect = KinectSensor.KinectSensors
                                      .FirstOrDefault(x => x.Status == KinectStatus.Connected);

                        if (this.Kinect == null)
                        {
                            //Notify the user that the sensor is disconnected 
                        }
                    }
                    break;

                //Handle all other statuses according to needs 
            }
        }
开发者ID:Kazhunter,项目名称:Kinect,代码行数:28,代码来源:MainWindow.xaml.cs

示例3: KinectSensors_StatusChanged

 /// <summary>
 /// Handles the StatusChanged event of the KinectSensors control.
 /// </summary>
 /// <param name="sender">The source of the event.</param>
 /// <param name="e">The <see cref="Microsoft.Kinect.StatusChangedEventArgs"/> instance containing the event data.</param>
 void KinectSensors_StatusChanged(object sender, StatusChangedEventArgs e)
 {
     if (e.Status == KinectStatus.Connected)
     {
         //OpenKinect(e.Sensor);
     }
 }
开发者ID:spqchan,项目名称:EmotionRecognition,代码行数:12,代码来源:MainWindow.xaml.cs

示例4: Kinects_StatusChanged

 private void Kinects_StatusChanged(object sender, StatusChangedEventArgs e)
 {
     switch (e.Status)
     {
         case KinectStatus.Connected:
             var foundViewer = FindViewer(e.KinectRuntime);
             if (foundViewer != null)
             {
                 foundViewer.Kinect = e.KinectRuntime; //will cause a uninit, init
             }
             else if (viewerHolder.Items.Count < maxKinectCount)
             {
                 AddKinectViewer(e.KinectRuntime);
             }
             break;
         case KinectStatus.Disconnected:
             if (Runtime.Kinects.Count >= maxKinectCount)
             {
                 UpdateRuntimeOfKinectViewerToNextKinect(e.KinectRuntime);
             }
             else
             {
                 RemoveKinectViewer(e.KinectRuntime);
             }
             break;
         default:
             if (e.Status.HasFlag(KinectStatus.Error))
             {
                 DisableOrAddKinectViewer(e.KinectRuntime);
             }
             break;
     }
     UpdateUIBasedOnKinectCount();
 }
开发者ID:bbasseri,项目名称:Kinect-Windows-Pixelation-hack,代码行数:34,代码来源:MainWindow.xaml.cs

示例5: HandleServiceStatusChanged

		void HandleServiceStatusChanged (object sender, StatusChangedEventArgs e)
		{
			// handle when the service has finished being added
			if (e.WasAdded) {
				ExpandFirstOrUnconfiguredSection ();
			}
		}
开发者ID:kdubau,项目名称:monodevelop,代码行数:7,代码来源:ServiceDetailsWidget.cs

示例6: Kinects_StatusChanged

 void Kinects_StatusChanged(object sender, StatusChangedEventArgs e)
 {
     switch (e.Status)
     {
         case KinectStatus.Connected:
             if (kinectSensor == null)
             {
                 kinectSensor = e.Sensor;
                 Initialize();
             }
             break;
         case KinectStatus.Disconnected:
             if (kinectSensor == e.Sensor)
             {
                 Clean();
                 MessageBox.Show("Kinect was disconnected");
             }
             break;
         case KinectStatus.NotReady:
             break;
         case KinectStatus.NotPowered:
             if (kinectSensor == e.Sensor)
             {
                 Clean();
                 MessageBox.Show("Kinect is no more powered");
             }
             break;
         default:
             MessageBox.Show("Unhandled Status: " + e.Status);
             break;
     }
 }
开发者ID:Hitchhikrr,项目名称:harley,代码行数:32,代码来源:MainWindow.xaml.cs

示例7: KinectSensors_StatusChanged

        /// <summary>
        /// Kinectの接続状態が変わった時に呼び出される
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        void KinectSensors_StatusChanged( object sender, StatusChangedEventArgs e )
        {
            // デバイスが接続された
              if ( e.Status == KinectStatus.Connected ) {
            Start( e );
              }
              // デバイスが切断された
              else if ( e.Status == KinectStatus.Disconnected ) {
            Stop( e );
              }
              // ACが抜けてる
              else if ( e.Status == KinectStatus.NotPowered ) {
            Stop( e );

            MessageBox.Show( "電源ケーブルを接続してください" );
              }
              // Kinect for Xbox 360
              else if ( e.Status == KinectStatus.DeviceNotSupported ) {
            MessageBox.Show( "Kinect for Xbox 360 はサポートされません" );
              }
              // USBの帯域が足りない
              else if ( e.Status == KinectStatus.InsufficientBandwidth ) {
            MessageBox.Show( "USBの帯域が足りません" );
              }
        }
开发者ID:hatsunea,项目名称:KinectSDKBook4CS,代码行数:30,代码来源:MainWindow.xaml.cs

示例8: KinectSensorsStatusChanged

 void KinectSensorsStatusChanged(object sender, StatusChangedEventArgs e)
 {
     switch (e.Status)
     {
         case KinectStatus.Disconnected:
             if (_kinectSensor == e.Sensor)
             {
                 Clean();
                 Message = "Kinect disconnected";
             }
             break;
         case KinectStatus.Connected:
             _kinectSensor = e.Sensor;
             Initialize();
             break;
         case KinectStatus.NotPowered:
             Message = "Kinect is not powered";
             Clean();
             break;
         case KinectStatus.NotReady:
             Message = "Kinect is not ready";
             break;
         case KinectStatus.Initializing:
             Message = "Initializing";
             break;
         default:
             Message = string.Concat("Status: ", e.Status);
             break;
     }
 }
开发者ID:latish,项目名称:Kinect_Demo,代码行数:30,代码来源:MainWindow.xaml.cs

示例9: OnKinectStatusChanged

 private void OnKinectStatusChanged(object sender, StatusChangedEventArgs e)
 {
     switch (e.Status)
     {
         case KinectStatus.Connected:
             if (Kinect == null)
             {
                 Kinect = e.KinectRuntime;
                 Setup();
             }
             break;
         case KinectStatus.Disconnected:
             if (Kinect == e.KinectRuntime)
             {
                 Uninitialize();
                 MessageBox.Show("Kinect was disconnected.");
             }
             break;
         case KinectStatus.NotReady:
             break;
         default:
             MessageBox.Show("Unhandled Status: " + e.Status);
             break;
     }
 }
开发者ID:jnsn,项目名称:kinect,代码行数:25,代码来源:ConcreteKinectService.cs

示例10: KinectStatusChange

 /// <summary>
 /// A Debug function that gets called whenever the Kinect's state change. Since a state change 
 /// is usually a bad thing, this event handler will mainly print out diagnostic data.
 /// </summary>
 /// <param name="sender">The sending object</param>
 /// <param name="e">Contains data on the sensor</param>
 protected void KinectStatusChange(object sender, StatusChangedEventArgs e)
 {
     Console.WriteLine("[Client] Kinect's status changed!");
     Console.WriteLine("[Client] Kinect is running: {0}", e.Sensor.IsRunning);
     Console.WriteLine("[Client] Kinect Skeletal stream is enabled: {0}", e.Sensor.SkeletonStream.IsEnabled);
     Console.WriteLine("[Client] Kinect status: {0}", e.Sensor.Status);
     Console.WriteLine("[Client] Kinect device connection ID: {0}", e.Sensor.DeviceConnectionId);
 }
开发者ID:NUIC,项目名称:2-Kinects-1-Machine,代码行数:14,代码来源:KinectClient.cs

示例11: Sensor_StatusChanged

 /// <summary>
 /// Listens to status changes.
 /// Updates statuses as they change
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void Sensor_StatusChanged(object sender, StatusChangedEventArgs e)
 {
     deviceStatusArgs.CurrentStatus = GetStatus(e.Status);
     deviceStatusArgs.OriginalDeviceStatus = e.Status.ToString();
     Device_StatusChanged(deviceStatusArgs);
     sensor = null; // Because the Kinect SDK bugs when the Kinect is unplugged and plugged back in
                    // it is important to set the sensor to null so that a new instance is created in the Record method
                    // The bug message is "The Kinect is not ready" if the sensor's instance stays the same after it is plugged back 
 }
开发者ID:loic-lavergne,项目名称:mckineap,代码行数:15,代码来源:KinectManager.cs

示例12: KinectSensors_StatusChanged

        void KinectSensors_StatusChanged(object sender, StatusChangedEventArgs e)
        {
            if (kinectError != null)
            {
                MainWindow.animateSlide(kinectError, true, true);

                if (initialisingSpinner != null)
                {
                    MainWindow.animateSlide(initialisingSpinner, true, true);
                    initialisingSpinner = null;
                }
            }

            if (e.Status == KinectStatus.Connected)
            {
                MainWindow.restartMoto();
            }
            else
            {
                MainWindow.animateFade(imgDimmer, 0, 0.5);

                kinectError = MainWindow.generateError(e.Status);
                MainCanvas.Children.Add(kinectError);
                MainWindow.animateSlide(kinectError);

                if (e.Status == KinectStatus.Initializing)
                {
                    //Spinny, turny progress animation
                    initialisingSpinner = new Image();
                    initialisingSpinner.Source = new BitmapImage(new Uri(
            "/Moto;component/images/loading.png", UriKind.Relative));
                    MainCanvas.Children.Add(initialisingSpinner);
                    initialisingSpinner.Width = 150;
                    initialisingSpinner.Height = 150;
                    MainWindow.animateSlide(initialisingSpinner);
                    MainWindow.animateSpin(initialisingSpinner);
                    Canvas.SetTop(initialisingSpinner, 230);

                    Canvas.SetLeft(initialisingSpinner, (MainCanvas.ActualWidth / 2) - (initialisingSpinner.Width / 2));
                    //Add a "Moto will restart soon" message
                    restartMsg = new Image();
                    restartMsg.Source = new BitmapImage(new Uri(
            "/Moto;component/images/kinect-fault/restart.png", UriKind.Relative));
                    MainCanvas.Children.Add(restartMsg);
                    restartMsg.Width = 465;
                    restartMsg.Height = 37;
                    MainWindow.animateSlide(restartMsg);
                    Canvas.SetTop(restartMsg, 200);
                    Canvas.SetLeft(restartMsg, (MainCanvas.ActualWidth / 2) - (restartMsg.Width / 2));
                }
                else if (e.Status == KinectStatus.Disconnected)
                {
                    MainWindow.stopKinect(MainWindow.sensor);
                }
            }
        }
开发者ID:MattCrouch,项目名称:Moto,代码行数:56,代码来源:KinectError.xaml.cs

示例13: KinectSensors_StatusChanged

 //Statusfarbe "Kinect angeschlossen"=blau Fehler=rot "Initialisieren"=schwarz
 void KinectSensors_StatusChanged(object sender, StatusChangedEventArgs e)
 {
     if (StatusGerman(e.Status.ToString()) == "Initialisieren...")
         this.ViewModel.SensorColor = "Black";
     else if(StatusGerman(e.Status.ToString()) != "Kinect angeschlossen")
         this.ViewModel.SensorColor = "Red";
     else
         this.ViewModel.SensorColor  = "Green";
     this.ViewModel.SensorStatus = StatusGerman(e.Status.ToString());
     //this.ViewModel.SensorStatus = e.Status.ToString();
 }
开发者ID:KinAudio,项目名称:Master,代码行数:12,代码来源:MainWindow.xaml.cs

示例14: KinectSensors_StatusChanged

 void KinectSensors_StatusChanged(object sender, StatusChangedEventArgs e)
 {
     if (kinectSensor == e.Sensor)
     {
         if (e.Status == KinectStatus.Disconnected || e.Status == KinectStatus.NotPowered)
         {
             kinectSensor = null;
             DiscoverKinectSensor();
         }
     }
 }
开发者ID:Grutn,项目名称:B.rain-project,代码行数:11,代码来源:Game1.cs

示例15: KinectSensors_StatusChanged

        /// <summary>
        /// Handles the StatusChanged event of the KinectSensors control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="Microsoft.Kinect.StatusChangedEventArgs"/> instance containing the event data.</param>
        void KinectSensors_StatusChanged(object sender, StatusChangedEventArgs e)
        {
            this.Title = e.Status.ToString();
            if (e.Status == KinectStatus.Connected)
            {
                this.StartKinect();
            }
            else
            {
                this.StopKinect();
            }

        }
开发者ID:gopisivakanth,项目名称:Kinect_Controlled_Robotic_Arm_group10_cs308_2012,代码行数:18,代码来源:MainWindow.xaml.cs


注:本文中的StatusChangedEventArgs类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。