NotificationSettingProvider.cs 867 B

123456789101112131415161718192021222324252627
  1. using System.Collections.Generic;
  2. using Abp.Configuration;
  3. using Abp.Localization;
  4. namespace Abp.Notifications
  5. {
  6. public class NotificationSettingProvider : SettingProvider
  7. {
  8. public override IEnumerable<SettingDefinition> GetSettingDefinitions(SettingDefinitionProviderContext context)
  9. {
  10. return new[]
  11. {
  12. new SettingDefinition(
  13. NotificationSettingNames.ReceiveNotifications,
  14. "true",
  15. L("ReceiveNotifications"),
  16. scopes: SettingScopes.User,
  17. clientVisibilityProvider: new VisibleSettingClientVisibilityProvider())
  18. };
  19. }
  20. private static LocalizableString L(string name)
  21. {
  22. return new LocalizableString(name, AbpConsts.LocalizationSourceName);
  23. }
  24. }
  25. }