示例#1
0
        static ServiceProvider GetServices(IConfig config, ISpeechServicesAPIv20 sdk)
        {
            var services = new ServiceCollection()
                           .AddSingleton <IConfig>(config)
                           .AddSingleton <ISpeechServicesAPIv20>(sdk)
                           .BuildServiceProvider();

            return(services);
        }
示例#2
0
        public CommandLineApplication <MainApp> InitApp(ISpeechServicesAPIv20 apiObject)
        {
            var services = new ServiceCollection()
                           .AddSingleton <IConfig, Config>()
                           .AddSingleton <ISpeechServicesAPIv20>(apiObject)
                           .BuildServiceProvider();

            var writer = new MockTestWriter();
            var app    = new CommandLineApplication <MainApp>(new MockConsole(writer));

            app.Conventions.UseDefaultConventions().UseConstructorInjection(services);

            return(app);
        }
 public SpeechCommandBase(ISpeechServicesAPIv20 speechApi, IConsole console, IConfig config)
 {
     _speechApi = speechApi;
     _console   = console;
     _config    = config;
 }
 public EndpointCommand(ISpeechServicesAPIv20 speechApi, IConsole console) : base(speechApi, console, null)
 {
 }
 public TranscriptCommand(ISpeechServicesAPIv20 speechApi, IConsole console, IConfig config) : base(speechApi, console, config)
 {
 }