Exemplo n.º 1
0
        private void CmdPluginAdd_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            OpenFileDialog fileForm = new OpenFileDialog();

            fileForm.Title  = "Select package file to install";
            fileForm.Filter = "DLL libraries|*.dll|EXE files|*.exe|All files|*.*";
            if (fileForm.ShowDialog() == DialogResult.Cancel)
            {
                return;
            }

            PluginEditorView form = new PluginEditorView(fileForm.FileName);

            if (form.ShowDialog(this) == DialogResult.Cancel)
            {
                return;
            }

            try
            {
                StudioContext.PluginManager.Add(form.PluginPackage);
                this.PluginsChanged = true;
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Error);
            }

            this.Refresh();
        }
 /// <summary>
 ///     Hides and disposes of the PluginEditorView.
 /// </summary>
 public void ClosePluginEditor()
 {
     if (this.PluginEditorView != null)
     {
         this.PluginEditorView.Dispose();
         this.PluginEditorView = null;
     }
 }
        /// <summary>
        ///     Creates and initializes the PluginEditorView if it does not already exist.
        /// </summary>
        public void EnsurePluginEditorExists()
        {
            if (this.PluginEditorView == null)
            {
                this.PluginEditorView = new PluginEditorView();

                this.PluginEditorView.CreateControl();
                this.PluginEditorView.Init(this.MssParameters,
                                           this.mappingMgr,
                                           this.genMappingMgr,
                                           this.MssProgramMgr,
                                           this.transformPresetMgr,
                                           this.DryMssEventOutputPort,
                                           this.HostInfoOutputPort,
                                           this.activeMappingInfo);
            }
        }