Exemplo n.º 1
0
        /// <summary>
        /// The Init method is called when the plug-in is loaded by MediaBrowser.  You should perform all your specific initializations
        /// here - including adding your theme to the list of available themes.
        /// </summary>
        /// <param name="kernel"></param>
        public override void Init(Kernel kernel)
        {
            try
            {
                kernel.AddTheme("Diamond", "resx://Diamond/Diamond.Resources/Page#PageDiamond", "resx://Diamond/Diamond.Resources/DetailMovieView#DiamondMovieView");
                isMC = AppDomain.CurrentDomain.FriendlyName.Contains("ehExtHost");
                if (isMC)
                {
                    config = new Config();
                    kernel.AddConfigPanel("Diamond Options", "resx://Diamond/Diamond.Resources/ConfigPanel#ConfigPanel", config);
                    kernel.AddInternalIconTheme("Diamond"); //tells core that we want to use icons in our resource file
                    //Tell the log we loaded.
                    Logger.ReportInfo("Diamond Theme Loaded.");
                    //Thread t = new Thread(new ThreadStart(Display));
                    //t.Start();
                }
                else
                {
                    Logger.ReportInfo("Not creating menus for Diamond.  Appear to not be in MediaCenter.  AppDomain is: " + AppDomain.CurrentDomain.FriendlyName);
                }

                kernel.StringData.AddStringData(MyStrings.FromFile(MyStrings.GetFileName("Diamond-")));
                CustomResourceManager.AppendFonts("Diamond", Resources.DiamondFontsDefault, Resources.DiamondFontsSmall);
                CustomResourceManager.AppendStyles("Diamond", Resources.DiamondStylesDefault, Resources.DiamondStylesDefault);
            }
            catch (Exception ex)
            {
                Logger.ReportException("Error adding theme - probably incompatable MB version", ex);
            }
        }
Exemplo n.º 2
0
 public override void Init(Kernel kernel)
 {
     try
     {
         kernel.AddTheme("Chocolate", "resx://Chocolate/Chocolate.Resources/Page#PageChocolate", "resx://Chocolate/Chocolate.Resources/DetailMovieView#ChocolateMovieView");
         if (AppDomain.CurrentDomain.FriendlyName.Contains("ehExtHost"))
         {
             this.config = new MyConfig();
             kernel.AddConfigPanel("Chocolate General", "resx://Chocolate/Chocolate.Resources/ConfigPanel#ConfigPanel", this.config);
             kernel.AddConfigPanel("Chocolate Views", "resx://Chocolate/Chocolate.Resources/ConfigPanelViews#ConfigPanelViews", this.config);
         }
         else
         {
             Logger.ReportInfo("Not creating menus for Chocolate.  Appear to not be in MediaCenter.  AppDomain is: " + AppDomain.CurrentDomain.FriendlyName);
         }
         kernel.StringData.AddStringData(MyStrings.FromFile(LocalizedStringData.GetFileName("Chocolate-")));
         CustomResourceManager.AppendFonts("Chocolate", Resources.Fonts, Resources.FontsSmall);
         CustomResourceManager.AppendStyles("Chocolate", Resources.Colors, Resources.Colors);
         Logger.ReportInfo("Chocolate Theme (version " + this.Version + ") Loaded.");
     }
     catch (Exception exception)
     {
         Logger.ReportException("Error adding theme - probably incompatable MB version", exception);
     }
 }