Ejemplo n.º 1
0
        /// <summary>
        /// Start the IR Server plugin.
        /// </summary>
        public override void Start()
        {
            LoadSettings();

            if (String.IsNullOrEmpty(_pluginFile))
            {
                throw new InvalidOperationException("No girder plugin file selected");
            }

            string file = Path.Combine(_pluginFolder, _pluginFile);

            _pluginWrapper = new GirderPluginWrapper(file);

            _pluginWrapper.EventCallback += PluginCallback;

            if (!_pluginWrapper.GirOpen())
            {
                _pluginWrapper.Dispose();
                _pluginWrapper = null;

                throw new InvalidOperationException("Failed to initiate girder plugin");
            }

            if (!_pluginWrapper.GirStart())
            {
                _pluginWrapper.GirClose();
                _pluginWrapper.Dispose();
                _pluginWrapper = null;

                throw new InvalidOperationException("Failed to start girder plugin");
            }
        }
Ejemplo n.º 2
0
        private void buttonConfigureGirderPlugin_Click(object sender, EventArgs e)
        {
            if (listViewPlugins.SelectedIndices.Count != 1)
            {
                return;
            }

            try
            {
                string pluginFile = Path.Combine(textBoxPluginFolder.Text, listViewPlugins.SelectedItems[0].Text);

                GirderPluginWrapper pluginWrapper = new GirderPluginWrapper(pluginFile);

                pluginWrapper.GirOpen();

                if (!pluginWrapper.CanConfigure)
                {
                    MessageBox.Show(this, "No configuration available", "Girder Plugin Configuration", MessageBoxButtons.OK,
                                    MessageBoxIcon.Information);
                }
                else
                {
                    pluginWrapper.GirCommandGui();

                    MessageBox.Show(this, "Press OK after the Girder plugin configuration is complete",
                                    "Girder Plugin Configuration", MessageBoxButtons.OK, MessageBoxIcon.Information);
                }

                pluginWrapper.GirClose();

                pluginWrapper.Dispose();
            }
            catch (Exception ex)
            {
                MessageBox.Show(this, ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Ejemplo n.º 3
0
    private void buttonConfigureGirderPlugin_Click(object sender, EventArgs e)
    {
      if (listViewPlugins.SelectedIndices.Count != 1)
        return;

      try
      {
        string pluginFile = Path.Combine(textBoxPluginFolder.Text, listViewPlugins.SelectedItems[0].Text);

        GirderPluginWrapper pluginWrapper = new GirderPluginWrapper(pluginFile);

        pluginWrapper.GirOpen();

        if (!pluginWrapper.CanConfigure)
        {
          MessageBox.Show(this, "No configuration available", "Girder Plugin Configuration", MessageBoxButtons.OK,
                          MessageBoxIcon.Information);
        }
        else
        {
          pluginWrapper.GirCommandGui();

          MessageBox.Show(this, "Press OK after the Girder plugin configuration is complete",
                          "Girder Plugin Configuration", MessageBoxButtons.OK, MessageBoxIcon.Information);
        }

        pluginWrapper.GirClose();

        pluginWrapper.Dispose();
      }
      catch (Exception ex)
      {
        MessageBox.Show(this, ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
      }
    }
Ejemplo n.º 4
0
    /// <summary>
    /// Start the IR Server plugin.
    /// </summary>
    public override void Start()
    {
      LoadSettings();

      if (String.IsNullOrEmpty(_pluginFile))
        throw new InvalidOperationException("No girder plugin file selected");

      string file = Path.Combine(_pluginFolder, _pluginFile);

      _pluginWrapper = new GirderPluginWrapper(file);

      _pluginWrapper.EventCallback += PluginCallback;

      if (!_pluginWrapper.GirOpen())
      {
        _pluginWrapper.Dispose();
        _pluginWrapper = null;

        throw new InvalidOperationException("Failed to initiate girder plugin");
      }

      if (!_pluginWrapper.GirStart())
      {
        _pluginWrapper.GirClose();
        _pluginWrapper.Dispose();
        _pluginWrapper = null;

        throw new InvalidOperationException("Failed to start girder plugin");
      }
    }