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); } } }
public override void SetPlugin(SC.Interfaces.IScPluginClient plugin) { if (plugin != null && plugin is SC.Interfaces.IScServerPluginClient) { this.plugin = plugin as SC.Interfaces.IScServerPluginClient; } RefreshView(); }
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); }
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()); }
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(); }
public override void SetPlugin(SC.Interfaces.IScPluginClient plugin) { this.plugin = plugin as SC.Interfaces.DefaultPlugins.ITimerPlugin; RefreshView(); }
public bool IsPanelForPlugin(SC.Interfaces.IScPluginClient plugin) { SC.GUI.Utility.PluginPanelAttribute attr = GetPluginPanelAttribute(pluginPanelType); return(attr.InterfaceType.IsInstanceOfType(plugin)); }
public virtual void SetPlugin(SC.Interfaces.IScPluginClient plugin) { throw new NotImplementedException(); }