You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
|
using FactoryMethod.Creators;
|
|
|
|
|
using FactoryMethod.Products;
|
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Linq;
|
|
|
|
|
using System.Text;
|
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
|
|
|
|
|
namespace FactoryMethod
|
|
|
|
|
{
|
|
|
|
|
internal class Client
|
|
|
|
|
{
|
|
|
|
|
public void Main()
|
|
|
|
|
{
|
|
|
|
|
Console.WriteLine("App: Launched with the ConcreateCreator1");
|
|
|
|
|
ClinetCode(new ConcreateCreator1());
|
|
|
|
|
|
|
|
|
|
Console.WriteLine("---");
|
|
|
|
|
|
|
|
|
|
Console.WriteLine("App: Launched with the ConcreateCreator2");
|
|
|
|
|
ClinetCode(new ConcreateCreator2());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void ClinetCode(Creator creator)
|
|
|
|
|
{
|
|
|
|
|
Console.WriteLine($"Client: I'm not aware of the creator's class, " +
|
|
|
|
|
$"but it still works. {creator.SomeOperation()}");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|