コード例 #1
0
ファイル: Program.cs プロジェクト: Desz01ate/BroadCapture
 static async Task Main(string[] args)
 {
     handler = new ConsoleEventDelegate(ConsoleEventCallback);
     SetConsoleCtrlHandler(handler, true);
     using (var scope = ConfigurationContainer.Configure().BeginLifetimeScope())
     {
         var app = scope.Resolve <Application>();
         await app.RunAsync();
     }
 }
コード例 #2
0
        public void CallBackTest(string section)
        {
            string testString   = "test";
            int    testInt      = 75;
            var    configurator = new ConfigurationContainer(this.GetConfiguration(testInt, testString, section));

            ConfigurationItem result = null;

            configurator.Configure <ConfigurationItem>(section, item => { result = item; });

            result.Should().NotBeNull();
            result.TestInt.Should().Be(testInt);
            result.TestString.Should().Be(testString);
        }
コード例 #3
0
        public CommandsHandler()
        {
            var dbContext = ConfigurationContainer.Configure().Resolve <IDbContext>();

            this._dbContext = dbContext;
        }