Ejemplo n.º 1
0
        //perform the core construction of app instance,
        //this is a method because of C# inability to control ctor chaining sequence
        //this is framework internal code, developers do not call
        protected void Constructor(bool allowNesting,
                                   string[] cmdLineArgs,
                                   ConfigSectionNode rootConfig,
                                   IApplicationDependencyInjectorImplementation defaultDI = null)
        {
            m_AllowNesting = allowNesting;

            if (cmdLineArgs != null && cmdLineArgs.Length > 0)
            {
                var acfg = new CommandArgsConfiguration(cmdLineArgs)
                {
                    Application = this
                };
                m_CommandArgs = acfg.Root;
            }
            else
            {
                var acfg = new MemoryConfiguration {
                    Application = this
                };
                m_CommandArgs = acfg.Root;
            }

            m_ConfigRoot = rootConfig ?? GetConfiguration().Root;
            m_Singletons = new ApplicationSingletonManager();
            m_NOPApplicationSingletonManager = new NOPApplicationSingletonManager();
            m_DefaultDependencyInjector      = defaultDI ?? new ApplicationDependencyInjector(this);
            m_Realm = new ApplicationRealmBase(this);

            m_NOPLog             = new NOPLog(this);
            m_NOPModule          = new NOPModule(this);
            m_NOPInstrumentation = new NOPInstrumentation(this);
            m_NOPDataStore       = new NOPDataStore(this);
            m_NOPObjectStore     = new NOPObjectStore(this);
            m_NOPGlue            = new NOPGlue(this);
            m_NOPSecurityManager = new NOPSecurityManager(this);
            m_DefaultTimeSource  = new DefaultTimeSource(this);
            m_NOPEventTimer      = new NOPEventTimer(this);
        }
Ejemplo n.º 2
0
        public TestApplication(ConfigSectionNode cfgRoot = null)
        {
            this.ConfigRoot = cfgRoot;

            Singletons         = new ApplicationSingletonManager();
            DependencyInjector = new ApplicationDependencyInjector(this);
            Active             = true;
            StartTime          = DateTime.Now;
            Log             = new NOPLog(this);
            Instrumentation = new NOPInstrumentation(this);
            DataStore       = new NOPDataStore(this);
            ObjectStore     = new NOPObjectStore(this);
            Glue            = new NOPGlue(this);
            ModuleRoot      = new NOPModule(this);
            SecurityManager = new NOPSecurityManager(this);
            TimeSource      = new DefaultTimeSource(this);
            TimeLocation    = TimeLocation.Parent;
            EventTimer      = new NOPEventTimer(this);

            Realm = new ApplicationRealmBase(this);

            Apps.ExecutionContext.__BindApplication(this);
        }