Пример #1
0
        protected virtual DAO InternalSelect <DAO>(Type daoType) where DAO : DaoReadable
        {
            QuillComponent component = QuillInjector.GetInstance().Container.GetComponent(daoType);
            DAO            dao       = (DAO)component.GetComponentObject(daoType);

            return(dao);
        }
Пример #2
0
        // ===============================================================================
        //                                                                  Implementation
        //                                                                  ==============
        public virtual DAO Select <DAO>() where DAO : DaoReadable
        {
            Type           daoType   = typeof(DAO);
            QuillComponent component = QuillInjector.GetInstance().Container.GetComponent(daoType);
            DAO            dao       = (DAO)component.GetComponentObject(daoType);

            return(dao);
        }
        protected virtual BEHAVIOR InternalSelect <BEHAVIOR>(Type behaviorType) where BEHAVIOR : BehaviorReadable
        {
            QuillComponent component = QuillInjector.GetInstance().Container.GetComponent(behaviorType);
            BEHAVIOR       bhv       = (BEHAVIOR)component.GetComponentObject(behaviorType);

            if (bhv.IsInitialized)
            {
                return(bhv);
            }
            QuillInjector.GetInstance().Inject(bhv);
            return(bhv);
        }
        // ===============================================================================
        //                                                                  Implementation
        //                                                                  ==============
        public virtual BEHAVIOR Select <BEHAVIOR>() where BEHAVIOR : BehaviorReadable
        {
            Type           behaviorType = typeof(BEHAVIOR);
            QuillComponent component    = QuillInjector.GetInstance().Container.GetComponent(behaviorType);
            BEHAVIOR       bhv          = (BEHAVIOR)component.GetComponentObject(behaviorType);

            if (bhv.IsInitialized)
            {
                return(bhv);
            }
            QuillInjector.GetInstance().Inject(bhv);
            return(bhv);
        }