示例#1
0
 public Client(AbstractFactory abstractFactory)
 {
     abstractProductA = abstractFactory.CreateProductA();
     Console.WriteLine($"{abstractFactory.GetType().Name} created {abstractProductA.GetType().Name}");
     abstractProductB = abstractFactory.CreateProductB();
     Console.WriteLine($"{abstractFactory.GetType().Name} created {abstractProductB.GetType().Name}");
 }
        public void Check_Abstract_Factory_Returns_Correct_Objects()
        {
            AbstractFactory  factory1 = new Factory1();
            AbstractProductA product1 = factory1.CreateProductA();
            AbstractProductB product2 = factory1.CreateProductB();

            Assert.AreEqual(product1.GetType(), typeof(ProductA1));
            Assert.AreEqual(product2.GetType(), typeof(ProductB1));
        }
示例#3
0
        public override void Interact(AbstractProductA a)
        {
            MessageBox.Show(this.GetType().Name +

                            " interacts with " + a.GetType().Name);
        }
示例#4
0
 public void Run()
 {
     Console.WriteLine(prA.GetType().ToString());
     Console.Beep();
 }
示例#5
0
 public override void Interact(AbstractProductA productA)
 {
     Debug.Log(GetType().Name + "interacts with" + productA.GetType().Name);
 }
示例#6
0
 public override void Interact(AbstractProductA a)
 {
     Debug.Log(this.GetType().Name + " interacts with " + a.GetType().Name);
 }
示例#7
0
 public override void Interact(AbstractProductA a)
 {
     Utility.LogEntry(this.GetType().Name +
                      " interacts with " + a.GetType().Name);
 }
示例#8
0
 public void Interact(AbstractProductA a)
 {
     Console.WriteLine($"{this.GetType().Name} interacts with {a.GetType().Name}");
 }
示例#9
0
 public override void Interact(AbstractProductA productA)
 {
     Console.WriteLine("{0} interacts with {1}", this.GetType().Name, productA.GetType().Name);
 }
示例#10
0
 public override void Interact(AbstractProductA a)
 {
     Console.WriteLine(this.GetType().Name + " interact with " + a.GetType().Name);
 }
示例#11
0
 public override string Interact(AbstractProductA abstractProductA)
 {
     return($"{GetType().Name} efetuando interações com {abstractProductA.GetType().Name}");
 }
示例#12
0
 public override void Interact(AbstractProductA a)
 {
     Log.WriteLine(GetType().Name +
                   " interacts with " + a.GetType().Name);
 }
示例#13
0
 public override void Wytworz(AbstractProductA typ)
 {
     Console.WriteLine(this.GetType().Name + " jest wytwarzany w wersji " + typ.GetType().Name);
 }
示例#14
0
 public override void interact(AbstractProductA producta)
 {
     Console.WriteLine("This {0} class interact with {1} class", this.GetType().Name, producta.GetType().Name);
 }
示例#15
0
 public override void Interact(AbstractProductA productA)
 {
     Console.WriteLine("Product B2 + " + productA.GetType().Name);
 }
示例#16
0
 public override string Interact(AbstractProductA a, bool test)
 {
     return(this.GetType().Name +
            " interacts with " + a.GetType().Name);
 }
 public override string Interagir(AbstractProductA a)
 {
     return String.Format(this.GetType().Name + " interage com " + a.GetType().Name);
 }
 public override void Interact(AbstractProductA productA) => Debug.WriteLine(GetType().Name + " interacts with " + productA.GetType().Name);
示例#19
0
 public override void Interact(AbstractProductA a)
 {
     Console.WriteLine(this.GetType().Name +
                       " interacts with " + a.GetType().Name);
 }
示例#20
0
 internal override string Interact(AbstractProductA a)
 {
     return(this.GetType().Name +
            " interacts with " + a.GetType().Name);
 }