ConfigurationPageInfo.cs 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. #pragma warning disable CS1591
  2. using MediaBrowser.Common.Plugins;
  3. using MediaBrowser.Controller.Plugins;
  4. using MediaBrowser.Model.Plugins;
  5. namespace MediaBrowser.WebDashboard.Api
  6. {
  7. public class ConfigurationPageInfo
  8. {
  9. public ConfigurationPageInfo(IPluginConfigurationPage page)
  10. {
  11. Name = page.Name;
  12. ConfigurationPageType = page.ConfigurationPageType;
  13. if (page.Plugin != null)
  14. {
  15. DisplayName = page.Plugin.Name;
  16. // Don't use "N" because it needs to match Plugin.Id
  17. PluginId = page.Plugin.Id.ToString();
  18. }
  19. }
  20. public ConfigurationPageInfo(IPlugin plugin, PluginPageInfo page)
  21. {
  22. Name = page.Name;
  23. EnableInMainMenu = page.EnableInMainMenu;
  24. MenuSection = page.MenuSection;
  25. MenuIcon = page.MenuIcon;
  26. DisplayName = string.IsNullOrWhiteSpace(page.DisplayName) ? plugin.Name : page.DisplayName;
  27. // Don't use "N" because it needs to match Plugin.Id
  28. PluginId = plugin.Id.ToString();
  29. }
  30. /// <summary>
  31. /// Gets or sets the name.
  32. /// </summary>
  33. /// <value>The name.</value>
  34. public string Name { get; set; }
  35. public bool EnableInMainMenu { get; set; }
  36. public string MenuSection { get; set; }
  37. public string MenuIcon { get; set; }
  38. public string DisplayName { get; set; }
  39. /// <summary>
  40. /// Gets or sets the type of the configuration page.
  41. /// </summary>
  42. /// <value>The type of the configuration page.</value>
  43. public ConfigurationPageType ConfigurationPageType { get; set; }
  44. /// <summary>
  45. /// Gets or sets the plugin id.
  46. /// </summary>
  47. /// <value>The plugin id.</value>
  48. public string PluginId { get; set; }
  49. }
  50. }