コード例 #1
0
        protected virtual void DoModuleAfterInitApplication()
        {
            const string FROM = INIT_FROM + ".mod";

            if (m_Module != null)
            {
                WriteLog(MessageType.Trace, FROM, "Call module root DI and .ApplicationAfterInit()");
                try
                {
                    this.DependencyInjector.InjectInto(m_Module);
                }
                catch (Exception error)
                {
                    var msg = "Error performing DI into module root:" + error.ToMessageWithType();
                    WriteLog(MessageType.CatastrophicError, FROM, msg, error);
                    throw new AzosException(msg, error);
                }
                try
                {
                    m_Module.ApplicationAfterInit();
                }
                catch (Exception error)
                {
                    var msg = "Error in call module root .ApplicationAfterInit()" + error.ToMessageWithType();
                    WriteLog(MessageType.CatastrophicError, FROM, msg, error);
                    throw new AzosException(msg, error);
                }
            }

            WriteLog(MessageType.Trace, FROM, "Common application initialized in '{0}' time location".Args(this.TimeLocation));

            var related = WriteLog(MessageType.Trace, FROM, "Component dump:");

            foreach (var cmp in ApplicationComponent.AllComponents(this))
            {
                WriteLog(MessageType.Info,
                         FROM,
                         "  -> Component: {0}  '{1}'  '{2}' ".Args(cmp.ComponentSID, cmp.GetType().FullName, cmp.ComponentCommonName),
                         related: related);
            }
        }
コード例 #2
0
 /// <summary>
 /// Returns an existing application component instance by its ComponentCommonName or null. The search is case-insensitive
 /// </summary>
 public IApplicationComponent GetComponentByCommonName(string name)
 {
     return(ApplicationComponent.GetAppComponentByCommonName(this, name));
 }
コード例 #3
0
 /// <summary>
 /// Returns a component by SID or null
 /// </summary>
 public IApplicationComponent GetComponentBySID(ulong sid)
 {
     return(ApplicationComponent.GetAppComponentBySID(this, sid));
 }
コード例 #4
0
 /// <summary>
 /// Returns an existing application component instance by its ComponentCommonName or null. The search is case-insensitive
 /// </summary>
 public IApplicationComponent GetComponentByCommonName(string name)
 => ApplicationComponent.GetAppComponentByCommonName(this, name);
コード例 #5
0
 /// <summary>
 /// Returns a component by SID or null
 /// </summary>
 public IApplicationComponent GetComponentBySID(ulong sid)
 => ApplicationComponent.GetAppComponentBySID(this, sid);