Пример #1
0
        private void PluginClicked(SC.Interfaces.IScPluginClient plugin)
        {
            int y = 0;

            pnlContent.Controls.Clear();
            SC.GUI.Utility.PluginPanelBase[] panels = null;
            try
            {
                panels = pluginPanelLoader.GetPanels(plugin);
            }
            catch (Exception e)
            {
                SC.GUI.Utility.ErrorForm.ShowErrorForm(e);
                return;
            }
            foreach (SC.GUI.Utility.PluginPanelBase panel in panels)
            {
                try
                {
                    panel.Name     = plugin.ToString() + y;
                    panel.Location = new Point(0, y);
                    y += panel.Size.Height + 10;
                    pnlContent.Controls.Add(panel);
                    panel.Show();
                }
                catch (Exception e)
                {
                    SC.GUI.Utility.ErrorForm.ShowErrorForm(e);
                }
            }
        }
Пример #2
0
        public override void SetPlugin(SC.Interfaces.IScPluginClient plugin)
        {
            if (plugin != null && plugin is SC.Interfaces.IScServerPluginClient)
            {
                this.plugin = plugin as SC.Interfaces.IScServerPluginClient;
            }

            RefreshView();
        }
Пример #3
0
        public SC.GUI.Utility.PluginPanelBase CreatePluginPanel(SC.Interfaces.IScPluginClient plugin)
        {
            if (!IsPanelForPlugin(plugin))
            {
                throw new ArgumentException("This plugin panel is for a different type of plugins.");
            }

            SC.GUI.Utility.PluginPanelBase pluginpanel = Activator.CreateInstance(pluginPanelType) as SC.GUI.Utility.PluginPanelBase;
            pluginpanel.SetPlugin(plugin);
            return(pluginpanel);
        }
Пример #4
0
        public SC.GUI.Utility.PluginPanelBase[] GetPanels(SC.Interfaces.IScPluginClient plugin)
        {
            List <SC.GUI.Utility.PluginPanelBase> ret = new List <SC.GUI.Utility.PluginPanelBase>();

            foreach (MetaPluginPanel meta in plugins)
            {
                if (meta.IsPanelForPlugin(plugin))
                {
                    ret.Add(meta.CreatePluginPanel(plugin));
                }
            }
            return(ret.ToArray());
        }
Пример #5
0
        public override void SetPlugin(SC.Interfaces.IScPluginClient plugin)
        {
            if (plugin == null)
            {
                throw new ArgumentNullException("plugin");
            }
            else if (!(plugin is SC.Interfaces.DefaultPlugins.IManualControl))
            {
                throw new ArgumentException("plugin");
            }

            this.plugin = plugin as SC.Interfaces.DefaultPlugins.IManualControl;
            RefreshView();
        }
Пример #6
0
 public override void SetPlugin(SC.Interfaces.IScPluginClient plugin)
 {
     this.plugin = plugin as SC.Interfaces.DefaultPlugins.ITimerPlugin;
     RefreshView();
 }
Пример #7
0
 public bool IsPanelForPlugin(SC.Interfaces.IScPluginClient plugin)
 {
     SC.GUI.Utility.PluginPanelAttribute attr = GetPluginPanelAttribute(pluginPanelType);
     return(attr.InterfaceType.IsInstanceOfType(plugin));
 }
Пример #8
0
 public virtual void SetPlugin(SC.Interfaces.IScPluginClient plugin)
 {
     throw new NotImplementedException();
 }