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();
        }