示例#1
0
        public ApplicationContext()
        {
            ApplicationBuilder = new ApplicationBuilder();
            Instances          = new Dictionary <string, object>();
            FileSystem         = new MockFileSystem();
            ScopeHolder        = new ScopeHolder();

            Application = new ApplicationBuilder()
                          .WithModule <EventHandling>()
                          .WithModule <EdgeHub>()
                          .WithModule <Configuration>()
                          .WithHandler <PrioritizerHandler>()
                          .WithType <Prioritizer>()
                          .WithManualRegistration(builder => builder.RegisterInstance(FileSystem).As <IFileSystem>())
                          .WithManualRegistration(builder => builder.RegisterInstance(ScopeHolder))
                          .WithTask <ScopeExposer>()
                          .Build();
        }
示例#2
0
 public ScopeExposer(ILifetimeScope scope, ScopeHolder scopeHolder)
 {
     ScopeHolder       = scopeHolder;
     ScopeHolder.Scope = scope;
 }