ConfigurationExtension.cs 776 B

1234567891011121314151617181920212223242526272829
  1. using System.Collections.Generic;
  2. using Emby.Dlna.Configuration;
  3. using MediaBrowser.Common.Configuration;
  4. namespace Emby.Dlna
  5. {
  6. public static class ConfigurationExtension
  7. {
  8. public static DlnaOptions GetDlnaConfiguration(this IConfigurationManager manager)
  9. {
  10. return manager.GetConfiguration<DlnaOptions>("dlna");
  11. }
  12. }
  13. public class DlnaConfigurationFactory : IConfigurationFactory
  14. {
  15. public IEnumerable<ConfigurationStore> GetConfigurations()
  16. {
  17. return new ConfigurationStore[]
  18. {
  19. new ConfigurationStore
  20. {
  21. Key = "dlna",
  22. ConfigurationType = typeof (DlnaOptions)
  23. }
  24. };
  25. }
  26. }
  27. }