示例#1
0
        public static TSettings GetSettings <TSettings>(this ISettingsService settingsService, ComponentId componentId) where TSettings : IComponentSettings
        {
            if (settingsService == null)
            {
                throw new ArgumentNullException(nameof(settingsService));
            }

            var uri = SettingsUriGenerator.From(componentId);

            return(settingsService.GetSettings <TSettings>(uri));
        }
示例#2
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));
        }
示例#3
0
        public static void CreateSettingsMonitor <TSettings>(this ISettingsService settingsService, AutomationId automationId, Action <TSettings> callback) where TSettings : IAutomationSettings
        {
            if (settingsService == null)
            {
                throw new ArgumentNullException(nameof(settingsService));
            }

            var uri = SettingsUriGenerator.From(automationId);

            settingsService.CreateSettingsMonitor(uri, callback);
        }
示例#4
0
        public static void CreateSettingsMonitor <TSettings>(this ISettingsService settingsService, Action <TSettings> callback)
        {
            if (settingsService == null)
            {
                throw new ArgumentNullException(nameof(settingsService));
            }

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

            settingsService.CreateSettingsMonitor(uri, callback);
        }
示例#5
0
        public static void SetSettings <TSettings>(this ISettingsService settingsService, AutomationId automationId, TSettings settings) where TSettings : IAutomationSettings
        {
            if (settingsService == null)
            {
                throw new ArgumentNullException(nameof(settingsService));
            }
            if (automationId == null)
            {
                throw new ArgumentNullException(nameof(automationId));
            }

            var uri = SettingsUriGenerator.From(automationId);

            settingsService.ImportSettings(uri, settings);
        }
示例#6
0
        public static TSettings GetSettings <TSettings>(this ISettingsService settingsService, AutomationId automationId) where TSettings : IAutomationSettings
        {
            if (settingsService == null)
            {
                throw new ArgumentNullException(nameof(settingsService));
            }
            if (automationId == null)
            {
                throw new ArgumentNullException(nameof(automationId));
            }

            var uri = SettingsUriGenerator.From(automationId);

            return(settingsService.GetSettings <TSettings>(uri));
        }
示例#7
0
        public static JObject GetRawSettings(this ISettingsService settingsService, AutomationId automationId)
        {
            if (settingsService == null)
            {
                throw new ArgumentNullException(nameof(settingsService));
            }
            if (automationId == null)
            {
                throw new ArgumentNullException(nameof(automationId));
            }

            var uri = SettingsUriGenerator.From(automationId);

            return(settingsService.GetSettings(uri));
        }