Exemple #1
0
        public void Macosx_Uretimi()
        {
            ToolFactory factory = new MacosxFactory();

            IDialog dialog = factory.CreateDialog();

            dialog.GetDialog();

            IToolbar toolbar = factory.CreateToolbar();

            toolbar.GetToolbar();
        }
Exemple #2
0
        public void Windows_Uretimi()
        {
            ToolFactory factory = new WindowsFactory();

            IDialog dialog = factory.CreateDialog();

            dialog.GetDialog();

            IToolbar toolbar = factory.CreateToolbar();

            toolbar.GetToolbar();
        }
        static void Main(string[] args)
        {
            "Merhaba Dünya!".WriteToConsole();
            "Abstract Factory Pattern Örneği\n".WriteToConsole();

            bool isMacosx = false;

            ToolFactory factory = isMacosx ?
                                  factory = new MacosxFactory()
                    : factory             = new WindowsFactory();

            IDialog dialog = factory.CreateDialog();

            dialog.GetDialog().WriteToConsole();

            IToolbar toolbar = factory.CreateToolbar();

            toolbar.GetToolbar().WriteToConsole();

            "\nDevam etmek için enter e basınız".WriteToConsole();
            System.Console.ReadLine();
        }