コード例 #1
0
        /// <summary>
        ///   Raises <see cref="TheEyeTribeSettingsDialog" /> to change the settings
        ///   for this interface.
        /// </summary>
        public override void ChangeSettings()
        {
            var dlg = new TheEyeTribeSettingsDialog {
                TheEyeTribeSettings = this.theEyeTribeSettings
            };

            switch (dlg.ShowDialog())
            {
            case DialogResult.OK:
                var oldServerStartParams = this.theEyeTribeSettings.ServerStartParams;
                this.theEyeTribeSettings = dlg.TheEyeTribeSettings;
                this.SerializeSettings(this.theEyeTribeSettings, this.SettingsFile);

                if (this.theEyeTribeSettings.ServerStartParams != oldServerStartParams)
                {
                    // Need to restart the eye tribe server if it is running
                    if (IOHelpers.IsProcessOpen("EyeTribe"))
                    {
                        this.KillEyeTribeProcess();

                        // Now restart
                        this.StartEyeTribeProcess();
                    }
                }

                break;
            }
        }
コード例 #2
0
ファイル: TheEyeTribeTracker.cs プロジェクト: DeSciL/Ogama
    /// <summary>
    ///   Raises <see cref="TheEyeTribeSettingsDialog" /> to change the settings
    ///   for this interface.
    /// </summary>
    public override void ChangeSettings()
    {
      var dlg = new TheEyeTribeSettingsDialog { TheEyeTribeSettings = this.theEyeTribeSettings };
      switch (dlg.ShowDialog())
      {
        case DialogResult.OK:
          var oldServerStartParams = this.theEyeTribeSettings.ServerStartParams;
          this.theEyeTribeSettings = dlg.TheEyeTribeSettings;
          this.SerializeSettings(this.theEyeTribeSettings, this.SettingsFile);

          if (this.theEyeTribeSettings.ServerStartParams != oldServerStartParams)
          {
            // Need to restart the eye tribe server if it is running
            if (IOHelpers.IsProcessOpen("EyeTribe"))
            {
              this.KillEyeTribeProcess();

              // Now restart 
              this.StartEyeTribeProcess();
            }
          }

          break;
      }
    }