本文整理汇总了C#中Kernel.AddTheme方法的典型用法代码示例。如果您正苦于以下问题:C# Kernel.AddTheme方法的具体用法?C# Kernel.AddTheme怎么用?C# Kernel.AddTheme使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Kernel
的用法示例。
在下文中一共展示了Kernel.AddTheme方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Init
/// <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);
}
}