示例#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>
        /// Enum added must have attribute for Display Text Key
        /// </summary>
        /// <typeparam name="TEnum"></typeparam>
        /// <param name="enumValue"></param>
        /// <returns></returns>
        public static string GetCaptionFromEnum <TEnum>(TEnum value) where TEnum : new()
        {
            DisplayTextKeyAttribute displayTextKeyAttribute = EnumAttributeUtility <TEnum, DisplayTextKeyAttribute> .GetEnumAttribute(value.ToString());

            return(ResourceUtility.GetCaptionFor(displayTextKeyAttribute.Key));
        }