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 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 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, IAutomation automation, Action <SettingsChangedEventArgs <TSettings> > callback) where TSettings : AutomationSettings { if (settingsService == null) { throw new ArgumentNullException(nameof(settingsService)); } var uri = SettingsUriGenerator.FromAutomation(automation.Id); settingsService.CreateSettingsMonitor(uri, callback); }
public static void CreateSettingsMonitor(this ISettingsService settingsService, IArea area, Action <SettingsChangedEventArgs <AreaSettings> > callback) { if (settingsService == null) { throw new ArgumentNullException(nameof(settingsService)); } var uri = SettingsUriGenerator.FromArea(area.Id); 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)); }
public static JObject GetRawSettings(this ISettingsService settingsService, IComponent component) { if (settingsService == null) { throw new ArgumentNullException(nameof(settingsService)); } if (component == null) { throw new ArgumentNullException(nameof(component)); } var uri = SettingsUriGenerator.FromComponent(component.Id); return(settingsService.GetSettings(uri)); }
public static void SetSettings <TSettings>(this ISettingsService settingsService, IComponent component, TSettings settings) where TSettings : ComponentSettings { if (settingsService == null) { throw new ArgumentNullException(nameof(settingsService)); } if (component == null) { throw new ArgumentNullException(nameof(component)); } var uri = SettingsUriGenerator.FromComponent(component.Id); settingsService.ImportSettings(uri, settings); }
public static JObject GetRawSettings(this ISettingsService settingsService, IArea area) { if (settingsService == null) { throw new ArgumentNullException(nameof(settingsService)); } if (area == null) { throw new ArgumentNullException(nameof(area)); } var uri = SettingsUriGenerator.FromArea(area.Id); return(settingsService.GetSettings(uri)); }