public static StateMachineHostBuilder AddHttpClient(this StateMachineHostBuilder builder)
        {
            if (builder is null)
            {
                throw new ArgumentNullException(nameof(builder));
            }

            builder.AddServiceFactory(HttpClientServiceFactory.Create(HttpClientServiceOptions.CreateDefault()));

            return(builder);
        }
        public static StateMachineHostBuilder AddNamedPipeIoProcessor(this StateMachineHostBuilder builder, string name, int?maxMessageSize = default)
        {
            if (builder is null)
            {
                throw new ArgumentNullException(nameof(builder));
            }

            builder.AddIoProcessorFactory(new NamedPipeIoProcessorFactory(name, maxMessageSize));

            return(builder);
        }
Exemple #3
0
        public static StateMachineHostBuilder AddEcmaScript(this StateMachineHostBuilder builder)
        {
            if (builder is null)
            {
                throw new ArgumentNullException(nameof(builder));
            }

            builder.AddDataModelHandlerFactory(EcmaScriptDataModelHandler.Factory);

            return(builder);
        }
        public static StateMachineHostBuilder AddSmtpClient(this StateMachineHostBuilder builder)
        {
            if (builder is null)
            {
                throw new ArgumentNullException(nameof(builder));
            }

            builder.AddServiceFactory(SmtpClientServiceFactory.Instance);

            return(builder);
        }
Exemple #5
0
        public static StateMachineHostBuilder AddHttpIoProcessor(this StateMachineHostBuilder builder, Uri baseUri, IPEndPoint ipEndPoint)
        {
            if (builder is null)
            {
                throw new ArgumentNullException(nameof(builder));
            }

            builder.AddIoProcessorFactory(new HttpIoProcessorFactory(baseUri, ipEndPoint));

            return(builder);
        }
        public static StateMachineHostBuilder AddSystemAction(this StateMachineHostBuilder builder)
        {
            if (builder is null)
            {
                throw new ArgumentNullException(nameof(builder));
            }

            builder.AddCustomActionFactory(SystemActionFactory.Instance);

            return(builder);
        }
        public static StateMachineHostBuilder AddHttpClient(this StateMachineHostBuilder builder, Action <HttpClientServiceOptions> setOptions)
        {
            if (builder is null)
            {
                throw new ArgumentNullException(nameof(builder));
            }
            if (setOptions is null)
            {
                throw new ArgumentNullException(nameof(setOptions));
            }

            var options = HttpClientServiceOptions.CreateDefault();

            setOptions(options);

            builder.AddServiceFactory(HttpClientServiceFactory.Create(options));

            return(builder);
        }