예제 #1
0
        /// <summary>
        /// Creates the specified DAC type.
        /// </summary>
        /// <param name="type">The DAC type.</param>
        /// <param name="args">The args.</param>
        /// <returns></returns>
        public IDataAccessComponent Create(DACType type, params object[] args)
        {
            // get attribuye value
            QualifiedTypeNameAttribute QualifiedNameAttr = EnumAttributeUtility <DACType, QualifiedTypeNameAttribute> .GetEnumAttribute(type.ToString());

            // create instance
            return((IDataAccessComponent)this.CreateObjectInstance(QualifiedNameAttr.AssemblyFileName, QualifiedNameAttr.QualifiedTypeName, args));
        }
예제 #2
0
        /// <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));
        }
예제 #3
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 fex;
            }
        }
예제 #4
0
 /// <summary>
 /// Determines whether the specified attr is valid.
 /// </summary>
 /// <param name="attribute">The attr.</param>
 /// <returns>
 ///     <c>true</c> if the specified attr is valid; otherwise, <c>false</c>.
 /// </returns>
 public static bool IsValid(QualifiedTypeNameAttribute attribute)
 {
     return(attribute != null && !ValidatorUtility.IsNullOrEmpty(attribute.AssemblyFileName) && !ValidatorUtility.IsNullOrEmpty(attribute.QualifiedTypeName));
 }