Ejemplo n.º 1
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));
        }
Ejemplo n.º 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);
        }
Ejemplo n.º 3
0
        private static void FacadeExample()
        {
            // Use a number of objects to complete a single operation
            // containing different stages through a single method call.
            var workerA = new WorkerTypeA();
            var workerB = new WorkerTypeB();
            var facade  = new FacadeType(workerA, workerB);

            facade.ComplicatedOperation();
        }
 /// <summary>
 /// Initializes a new instance of the <see cref="FacadeBase"/> class.
 /// </summary>
 /// <param name="facadeType">Type of the facade.</param>
 protected FacadeBase(FacadeType facadeType)
 {
     FacadeType = facadeType;
 }
Ejemplo n.º 5
0
 /// <summary>
 /// Initializes a new instance of the <see cref="FacadeBase"/> class.
 /// </summary>
 /// <param name="facadeType">Type of the facade.</param>
 protected FacadeBase(FacadeType facadeType)
 {
     FacadeType = facadeType;
 }