Exemplo n.º 1
0
        /// <summary>
        ///     Load all tabpages to the mainform
        /// </summary>
        private void LoadTabs()
        {
            if (!AddonManager.AddonsLoaded)
            {
                AddonManager.LoadAddons();
            }

            foreach (
                KeyValuePair <IAddon, UserControl> pair in
                AddonManager.TabsDictionary.OrderBy(i => GetTabDisplayId(i.Key.Name)))
            {
                // Create a new tabpage. We'll dock the control to fill the tabpage
                TabPage tp = new TabPage(pair.Key.Name)
                {
                    Name = pair.Key.Name
                };
                // Add and dock the control
                tp.Controls.Add(pair.Value);
                tp.Controls[0].Dock = DockStyle.Fill;

                // Add the tabpage
                TabCtrlAddons.TabPages.Add(tp);

                Logger.Log(LogLevel.Info, "mainform", "added addon tabpage", pair.Key.Name);
            }
            AddonManager.GetRequiredAddon(RequiredAddon.Settings).Initialize();
        }
Exemplo n.º 2
0
 private static Starter GetInstance()
 {
     return((Starter)AddonManager.GetRequiredAddon(RequiredAddon.Starter));
 }