コード例 #1
0
 public ServiceConfigurationBuilder(INavigationService navigationService, IActionInvokerFactory invokerFactory)
 {
     _navigationService = navigationService;
     _configuration     = ServiceConfiguration.CreateSilently(
         "My configuration name", "http://baseuri",
         _navigationService, invokerFactory);
 }
コード例 #2
0
        private ServiceConfiguration CreateServiceConfiguration(JObject jConfig)
        {
            var configuration = ServiceConfiguration.CreateSilently(
                jConfig.Get("Name"), jConfig.Get("BaseUri"),
                _navigationService, _invokerFactory);
            var actionGroups = jConfig.GetJArray("ActionGroups").Select(j => CreateActionGroup(j, configuration));

            configuration.ActionGroups.AddRange(actionGroups);
            return(configuration);
        }
コード例 #3
0
        private static ServiceConfiguration CreateConfiguration(int i)
        {
            var configuration = ServiceConfiguration.CreateSilently(
                $"Service Config {i}", "http://myserviceurl:1234",
                NavigationService, ActionInvokerFactory);
            var actions = Enumerable.Range(0, 7).Select(j => CreateAction(() => configuration.BaseUri, j));
            var groups  = Enumerable.Range(0, 6).Select(k => CreateGroup(configuration, actions, k));

            configuration.ActionGroups.AddRange(groups);
            return(configuration);
        }
コード例 #4
0
        private ServiceConfiguration CreateRealTestData()
        {
            var configuration = ServiceConfiguration.CreateSilently("Domoticz", "http://mediacomputer:8080",
                                                                    NavigationService, ActionInvokerFactory);

            ServiceAction[] actions =
            {
                ServiceAction.CreateSilently("On",                                        "json.htm?type=command&param=switchlight&idx=1&switchcmd=Set%20Level&level=15",
                                             "Get",                                       "",                                                                            "", () => configuration.BaseUri),
                ServiceAction.CreateSilently("Off",                                       "json.htm?type=command&param=switchlight&idx=1&switchcmd=Off",
                                             "Get",                                       "",                                                                            "", () => configuration.BaseUri)
            };
            var actionGroup = ActionGroup.CreateSilently("Dining Room", configuration, NavigationService);

            actionGroup.Actions.AddRange(actions);
            ActionGroup[] groups =
            {
                actionGroup
            };
            configuration.ActionGroups.AddRange(groups);
            return(configuration);
        }
コード例 #5
0
 private async void AddEmptyServiceConfiguration()
 {
     Configurations.Add(ServiceConfiguration.CreateSilently("", "", _navigationService, _invokerFactory, EditMode));
     await StoreDataAsync();
 }