/// <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); } }
/// <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); } }