示例#1
0
        /// <summary>
        /// Creates the specified BDC type.
        /// </summary>
        /// <param name="type">The type.</param>
        /// <param name="args">The args.</param>
        /// <returns></returns>
        public IBusinessDomainComponent Create(BdcType type, params object[] args)
        {
            // get attribute value
            QualifiedTypeNameAttribute qualifiedNameAttr = EnumAttributeUtility <BdcType, QualifiedTypeNameAttribute> .GetEnumAttribute(type.ToString());

            // create instance
            return((IBusinessDomainComponent)this.CreateObjectInstance(qualifiedNameAttr.AssemblyFileName, qualifiedNameAttr.QualifiedTypeName, args));
        }
        /// <summary>
        /// Creates the specified facade type.
        /// </summary>
        /// <param name="facadeType">The type.</param>
        /// <param name="args">The args.</param>
        /// <returns></returns>
        public IFacade Create(FacadeType facadeType, params object[] args)
        {
            // get atrribute value
            QualifiedTypeNameAttribute qualifiedNameAttr = EnumAttributeUtility <FacadeType, QualifiedTypeNameAttribute> .GetEnumAttribute(facadeType.ToString());

            // create instance
            return((IFacade)this.CreateObjectInstance(qualifiedNameAttr.AssemblyFileName, qualifiedNameAttr.QualifiedTypeName, args));
        }
        /// <summary>
        /// Creates the specified DAC type.
        /// </summary>
        /// <param name="type">The DAC type.</param>
        /// <param name="args">The args.</param>
        /// <returns></returns>
        public IViewModel Create(ViewType type, params object[] args)
        {
            // get attribuye value
            QualifiedTypeNameAttribute QualifiedNameAttr = EnumAttributeUtility <ViewType, QualifiedTypeNameAttribute> .GetEnumAttribute(type.ToString());

            IViewModel instance = null;

            // create instance

            instance = (IViewModel)this.CreateObjectInstance(QualifiedNameAttr.AssemblyFileName, QualifiedNameAttr.QualifiedTypeName, args);
            return(instance);
        }
示例#4
0
        /// <summary>
        /// Creates the specified DTO type.
        /// </summary>
        /// <param name="type">The type.</param>
        /// <param name="args">The args.</param>
        /// <returns></returns>
        public IDto Create(DtoType type, params object[] args)
        {
            // get type info
            QualifiedTypeNameAttribute qualifiedNameAttr = EnumAttributeUtility <DtoType, QualifiedTypeNameAttribute> .GetEnumAttribute(type.ToString());

            // Initialize instance
            IDto instance = null;

            // create instance
            instance = (IDto)this.CreateObjectInstance(qualifiedNameAttr.AssemblyFileName, qualifiedNameAttr.QualifiedTypeName, args);

            // return
            return(instance);
        }
示例#5
0
        /// <summary>
        /// Creates the specified Notice type.
        /// </summary>
        /// <param name="type">The type.</param>
        /// <param name="args">The args.</param>
        /// <returns></returns>
        public INotification Create(NotificationType type, params object[] args)
        {
            // get type info
            QualifiedTypeNameAttribute QualifiedNameAttr =
                EnumAttributeUtility <NotificationType, QualifiedTypeNameAttribute> .GetEnumAttribute(type.ToString());

            // Initialize instance
            INotification instance = null;

            // create instance
            instance =
                (INotification)
                this.CreateObjectInstance(QualifiedNameAttr.AssemblyFileName, QualifiedNameAttr.QualifiedTypeName, args);

            // return
            return(instance);
        }
示例#6
0
        /// <summary>
        /// Creates the specified DTO type.
        /// </summary>
        /// <param name="type">The type.</param>
        /// <param name="args">The args.</param>
        /// <returns></returns>
        public IDTO Create(DTOType type, params object[] args)
        {
            try
            {
                // get type info
                QualifiedTypeNameAttribute QualifiedNameAttr = EnumAttributeUtility <DTOType, QualifiedTypeNameAttribute> .GetEnumAttribute(type.ToString());

                // Initialize instance
                IDTO instance = null;

                // create instance
                instance = (IDTO)this.CreateObjectInstance(QualifiedNameAttr.AssemblyFileName, QualifiedNameAttr.QualifiedTypeName, args);

                // return
                return(instance);
            }
            catch (FactoryException fex)
            {
                throw;
            }
        }