Exemple #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);
        }
Exemple #2
0
        protected NOPApplication()
        {
            m_Configuration = new MemoryConfiguration();
            m_Configuration.Create();

            m_CommandArgsConfiguration = new MemoryConfiguration();
            m_CommandArgsConfiguration.Create();

            m_StartTime          = DateTime.Now;
            m_Singletons         = new NOPApplicationSingletonManager();
            m_DependencyInjector = new ApplicationDependencyInjector(this);
            m_Realm = new ApplicationRealmBase(this);

            m_Log             = new NOPLog(this);
            m_Instrumentation = new NOPInstrumentation(this);
            m_ObjectStore     = new NOPObjectStore(this);
            m_Glue            = new NOPGlue(this);
            m_DataStore       = new NOPDataStore(this);
            m_SecurityManager = new NOPSecurityManager(this);
            m_Module          = new NOPModule(this);
            m_TimeSource      = new DefaultTimeSource(this);
            m_EventTimer      = new EventTimer(this);
        }
Exemple #3
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);
        }