예제 #1
0
        public static TSettings GetSettings <TSettings>(this ISettingsService settingsService)
        {
            if (settingsService == null)
            {
                throw new ArgumentNullException(nameof(settingsService));
            }

            var uri = SettingsUriGenerator.From(typeof(TSettings));

            return(settingsService.GetSettings <TSettings>(uri));
        }
예제 #2
0
        public static void CreateSettingsMonitor <TSettings>(this ISettingsService settingsService, Action <SettingsChangedEventArgs <TSettings> > callback)
        {
            if (settingsService == null)
            {
                throw new ArgumentNullException(nameof(settingsService));
            }

            var uri = SettingsUriGenerator.From(typeof(TSettings));

            settingsService.CreateSettingsMonitor(uri, callback);
        }