Beispiel #1
0
 private void FrmMainLoad(object sender, EventArgs e)
 {
     if (HandleError(NiTE.Initialize()))
     {
         Text = @"Running by NiTE v" + NiTE.Version;
     }
     else
     {
         Environment.Exit(1);
     }
 }
Beispiel #2
0
 public static void Initialize()
 {
     OpenNI.Shutdown();//例外などで前回シャットダウンされなかった場合用
     OpenNI.Initialize();
     NiTE.Initialize();
     ConnectedDevices             = OpenNI.EnumerateDevices();
     OpenNI.OnDeviceConnected    += OpenNI_onDeviceConnected;
     OpenNI.OnDeviceDisconnected += OpenNI_onDeviceConnected;
     OpenNI.OnDeviceStateChanged += OpenNI_onDeviceStateChanged;
     Instance = new OpenNIManager();
 }
 private void Init()
 {
     try
     {
         HandleError(OpenNI.Initialize());
         NiTE.Initialize();
         OpenNI.OnDeviceConnected    += OpenNiOnDeviceConnectionStateChanged;
         OpenNI.OnDeviceDisconnected += OpenNiOnDeviceConnectionStateChanged;
         OpenNI.OnDeviceStateChanged += OpenNiOnDeviceStateChanged;
         UpdateDevicesList();
         notify.Visible = !Settings.Default.AutoNotification;
         ReadSettings();
     }
     catch (Exception ex)
     {
         MessageBox.Show(
             string.Format("Fatal Error: {0}", ex.Message),
             @"Execution Error",
             MessageBoxButtons.OK,
             MessageBoxIcon.Error);
         Environment.Exit(1);
     }
 }