-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathPlugin.cs
84 lines (76 loc) · 2.81 KB
/
Plugin.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
namespace Chocolate
{
using MediaBrowser.Library;
using MediaBrowser.Library.Localization;
using MediaBrowser.Library.Logging;
using MediaBrowser.Library.Plugins;
using MediaBrowser.Library.Util;
using System;
internal class Plugin : BasePlugin
{
private static readonly Guid ChocolateGuid = new Guid("8d66894c-89d3-4d25-97be-68501b24879a");
public MyConfig config;
public override void Init(Kernel kernel)
{
try
{
kernel.AddTheme("Chocolate", "resx://Chocolate/Chocolate.Resources/Page#PageChocolate", "resx://Chocolate/Chocolate.Resources/NewDetailMovieView#NewChocolateMovieView");
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);
ItemFactory.Instance.AddFactory(WholeSeriesFolderModel.IsOne, typeof(WholeSeriesFolderModel));
Logger.ReportInfo("Chocolate Theme (version " + this.Version + ") Loaded.");
}
catch (Exception exception)
{
Logger.ReportException("Error adding theme - probably incompatable MB version", exception);
}
}
public override string Description
{
get
{
return "The Smoothest of the bunch.";
}
}
public override bool InstallGlobally
{
get
{
return true;
}
}
public override string Name
{
get
{
return "Chocolate Theme";
}
}
public override Version RequiredMBVersion
{
get
{
return new Version(2, 6, 0, 0);
}
}
public override Version TestedMBVersion
{
get
{
return new Version(2, 6, 0, 0);
}
}
}
}