Esempio 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);
            }
        }
Esempio n. 2
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
            {
                //the AddTheme method will add your theme to the available themes in MediaBrowser.  You need to call it and send it
                //resx references to your mcml pages for the main "Page" selector and the MovieDetailPage for your theme.
                //The template should have generated some default pages and values for you here but you will need to create all the
                //specific mcml files for the individual views (or, alternatively, you can reference existing views in MB.
                kernel.AddTheme("Classic", "resx://Classic/Classic.Resources/Page#PageClassic", "resx://Classic/Classic.Resources/DetailMovieView#ClassicMovieView");

                //The AddConfigPanel method will allow you to extend the config page of MediaBrowser with your own options panel.
                //You must create this as an mcml UI that fits within the standard config panel area.  It must take Application and
                //FocusItem as parameters.  The project template should have generated an example ConfigPage.mcml that you can modify
                //or, if you don't wish to extend the config, remove it and the following call to AddConfigPanel
                //kernel.AddConfigPanel("Classic Options", "resx://Classic/Classic.Resources/ConfigPanel#ConfigPanel");

                //The AddStringData method will allow you to extend the localized strings used by MediaBrowser with your own.
                //This is useful for adding descriptive text to go along with your theme options.  If you don't have any theme-
                //specific options or other needs to extend the string data, remove the following call.
                //kernel.StringData.AddStringData(MyStrings.FromFile(MyStrings.GetFileName("Classic-")));

                //Tell the log we loaded.
                Logger.ReportInfo("Classic Theme Loaded.");
            }
            catch (Exception ex)
            {
                Logger.ReportException("Error adding theme - probably incompatable MB version", ex);
            }
        }
Esempio n. 3
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
            {
                //the AddTheme method will add your theme to the available themes in MediaBrowser.  You need to call it and send it
                //resx references to your mcml pages for the main "Page" selector and the MovieDetailPage for your theme.
                //The template should have generated some default pages and values for you here but you will need to create all the
                //specific mcml files for the individual views (or, alternatively, you can reference existing views in MB.
                kernel.AddTheme("Classic", "resx://Classic/Classic.Resources/Page#PageClassic", "resx://Classic/Classic.Resources/DetailMovieView#ClassicMovieView");

                //The AddConfigPanel method will allow you to extend the config page of MediaBrowser with your own options panel.
                //You must create this as an mcml UI that fits within the standard config panel area.  It must take Application and
                //FocusItem as parameters.  The project template should have generated an example ConfigPage.mcml that you can modify
                //or, if you don't wish to extend the config, remove it and the following call to AddConfigPanel
                //kernel.AddConfigPanel("Classic Options", "resx://Classic/Classic.Resources/ConfigPanel#ConfigPanel");

                //The AddStringData method will allow you to extend the localized strings used by MediaBrowser with your own.
                //This is useful for adding descriptive text to go along with your theme options.  If you don't have any theme-
                //specific options or other needs to extend the string data, remove the following call.
                //kernel.StringData.AddStringData(MyStrings.FromFile(MyStrings.GetFileName("Classic-")));

                //Tell the log we loaded.
                Logger.ReportInfo("Classic Theme Loaded.");
            }
            catch (Exception ex)
            {
                Logger.ReportException("Error adding theme - probably incompatable MB version", ex);
            }
        }
Esempio n. 4
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);
            }
        }