public void Add(oRAPage Page)
        {
            Pages.Add(Page);

            oRALabel l = new oRALabel
            {
                AutoSize = false,
                Width = 60,
                Height = 60,
                Icon_Normal = Page.Icon_Normal,
                Icon_Hot = Page.Icon_Hot,
                Location = new Point(0, TotalHeight),
                Index = Pages.Count - 1,
                Text = Page.Name,
            };
            l.MouseDown += ChangeTab;
            l.MouseEnter += HandleMouseEnter;
            l.MouseLeave += HandleMouseLeave;
            l.Paint += PaintOverride;
            Controls.Add(l);

            TabContainer.Controls.Add((Control)Page.Contents);
            if (Pages.Count == 1)
            {
                l.Activated = true;
                l.Refresh();
            }
            else
            {
                TabContainer.Controls.Remove((Control)Page.Contents);
            }
            TotalHeight += 61;
        }
 public void Remove(oRAPage Page)
 {
     Pages.Remove(Page);
     foreach (Control c in Controls)
     {
         if (c.GetType() == typeof(oRALabel) && c.Text == Page.Name)
             Controls.Remove(c);
     }
     TabContainer.Controls.Remove((Control)Page.Contents);
     TotalHeight -= 61;
 }
 public void Add(oRAPage page)
 {
     TabPages.Add(page);
 }
Ejemplo n.º 4
0
 private void InitializePlugins()
 {
     if (Directory.Exists(Environment.CurrentDirectory + @"\Plugins\"))
     {
         foreach (string pluginFile in Directory.GetFiles(Path.Combine(Environment.CurrentDirectory, "Plugins"), "*.dll", SearchOption.AllDirectories))
         {
             if (!Settings.ContainsSetting("DisabledPlugins") || !Settings.GetSetting("DisabledPlugins").Split(new[] { '|' }).Contains(pluginFile))
             {
                 Plugin p = Plugins.LoadPlugin(pluginFile);
                 if (p == null)
                     continue;
                 p.Instance.p_Data = oRAData;
                 p.Instance.p_Controls = oRAControls;
                 if (p.Instance.p_PluginTabItem != null)
                 {
                     p.Instance.p_PluginTabItem.Dock = DockStyle.Fill;
                     oRAPage page = new oRAPage
                     {
                         Description = p.Instance.p_Description,
                         Name = p.Instance.p_Name,
                         Contents = p.Instance.p_PluginTabItem,
                         Icon_Hot = p.Instance.p_PluginTabIcon_H,
                         Icon_Normal = p.Instance.p_PluginTabIcon_N,
                     };
                     MainContainer.TabPages.Add(page);
                 }
                 if (p.Instance.p_PluginMenuItem != null)
                 {
                     PluginsMenuItem.DropDownItems.Add(p.Instance.p_PluginMenuItem);
                 }
             }
         }
     }
 }