BaseConfigurationPage.cs 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. using MediaBrowser.Common.Plugins;
  2. using System.IO;
  3. namespace MediaBrowser.Controller.Plugins
  4. {
  5. /// <summary>
  6. /// Class BaseConfigurationPage
  7. /// </summary>
  8. public abstract class BaseConfigurationPage
  9. {
  10. /// <summary>
  11. /// Gets the name.
  12. /// </summary>
  13. /// <value>The name.</value>
  14. public abstract string Name { get; }
  15. /// <summary>
  16. /// Gets the description.
  17. /// </summary>
  18. /// <value>The description.</value>
  19. public virtual string Description
  20. {
  21. get { return string.Empty; }
  22. }
  23. /// <summary>
  24. /// Gets the type of the configuration page.
  25. /// </summary>
  26. /// <value>The type of the configuration page.</value>
  27. public virtual ConfigurationPageType ConfigurationPageType
  28. {
  29. get { return ConfigurationPageType.PluginConfiguration; }
  30. }
  31. /// <summary>
  32. /// Gets the HTML stream from manifest resource.
  33. /// </summary>
  34. /// <param name="resource">The resource.</param>
  35. /// <returns>Stream.</returns>
  36. protected Stream GetHtmlStreamFromManifestResource(string resource)
  37. {
  38. return GetType().Assembly.GetManifestResourceStream(resource);
  39. }
  40. /// <summary>
  41. /// Gets the HTML stream.
  42. /// </summary>
  43. /// <returns>Stream.</returns>
  44. public abstract Stream GetHtmlStream();
  45. /// <summary>
  46. /// Gets the name of the plugin.
  47. /// </summary>
  48. /// <value>The name of the plugin.</value>
  49. public virtual string OwnerPluginName
  50. {
  51. get { return GetOwnerPlugin().Name; }
  52. }
  53. /// <summary>
  54. /// Gets the owner plugin.
  55. /// </summary>
  56. /// <returns>BasePlugin.</returns>
  57. public abstract IPlugin GetOwnerPlugin();
  58. }
  59. /// <summary>
  60. /// Enum ConfigurationPageType
  61. /// </summary>
  62. public enum ConfigurationPageType
  63. {
  64. /// <summary>
  65. /// The plugin configuration
  66. /// </summary>
  67. PluginConfiguration,
  68. /// <summary>
  69. /// The none
  70. /// </summary>
  71. None
  72. }
  73. }