Пример #1
0
 public EditModel(IPluginRepository pluginRepository, PluginsController pluginsController, CategoriesController categoriesController)
 {
     _pluginRepository     = pluginRepository;
     _pluginsController    = pluginsController;
     _categoriesController = categoriesController;
     Categories            = new List <CategoryDetails>();
 }
Пример #2
0
        public void Setup()
        {
            _datacardId   = Guid.NewGuid().ToString();
            _datacardFake = new DatacardFake();

            _pluginsController = new PluginsController(_datacardFake);
        }
Пример #3
0
        /// <summary>
        /// Add the plugins.
        /// </summary>
        internal void AddPlugins()
        {
            TraceService.WriteLine("Connect::AddPlugins Version=" + this.ApplicationVersion);

            PluginsController controller = new PluginsController
            {
                DTE2 = this.VSInstance.ApplicationObject
            };

            controller.Run();
        }
Пример #4
0
        /// <summary>
        /// Loads a list of plugins into the control.
        /// </summary>
        /// <param name="plugins">List of plugin names as defined in the Plugins Registry.</param>
        public void LoadPlugins(List <string> plugins)
        {
            PluginsController plc = new PluginsController();

            foreach (string plugin in plugins)
            {
                XmlNode pluginNode = plc.GetPlugin(plugin);
                if (pluginNode != null)
                {
                    string pluginName      = pluginNode.Attributes["name"].Value;
                    string pluginClassName = pluginNode.Attributes["className"].Value;
                    string pathToControl   = BASE_PLUGIN_DIR + "/" + pluginName + "/" + pluginClassName + ".ascx";

                    if (System.IO.File.Exists(Server.MapPath(pathToControl)))
                    {
                        try
                        {
                            Control pluginControl = LoadControl(pathToControl);
                            SetControlValues(pluginName, pluginControl, pluginNode);
                            Panel p = new Panel();
                            p.Controls.Add(pluginControl);
                            p.Style.Add("margin-left", "auto");
                            p.Style.Add("margin-right", "auto");
                            p.Style.Add("padding", "5px");
                            p.Style.Add("float", "right");
                            PluginHolder.Controls.Add(pluginControl);
                        }
                        catch (Exception ex)
                        {
                            Label l = new Label();
                            l.Text = "Unable to Load " + plugin + " Plugin";
                            PluginHolder.Controls.Add(l);

                            // supress error to user but log
                            ExceptionHandler.Publish(ex);
                        }
                    }
                }
                else
                {
                    Label l = new Label();
                    l.Text = "Unable to Load " + plugin + " Plugin";
                    PluginHolder.Controls.Add(l);
                }
            }
        }
Пример #5
0
        /// <summary>
        /// Adds the plugins tool strip menu item click.
        /// </summary>
        /// <param name="sender">The sender.</param>
        /// <param name="e">The <see cref="EventArgs"/> instance containing the event data.</param>
        private void AddPluginsToolStripMenuItemClick(object sender, EventArgs e)
        {
            PluginsController controller = new PluginsController();

            controller.Run();
        }
Пример #6
0
 public AddModel(PluginsController pluginsController, CategoriesController categoriesController)
 {
     _pluginsController    = pluginsController;
     _categoriesController = categoriesController;
 }
 public ConfigToolModel(PluginsController pluginsController, IHttpContextAccessor context)
 {
     _pluginsController = pluginsController;
     _context           = context;
 }