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)); }
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)); }
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); }
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); }
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); }
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)); }
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)); }