Exemplo n.º 1
0
        public static void MainFunction()
        {
            IMessageWriter writer     = new ConsoleMessageWriter();
            var            salutation = new Salutation(writer);

            salutation.Exclaim();
        }
Exemplo n.º 2
0
        public static void MainFunction()
        {
            var typeName = ConfigurationManager.AppSettings["messageWriter"];
            var type     = Type.GetType(typeName, false);

            IMessageWriter writer = (IMessageWriter)Activator.CreateInstance(type);

            var salutation = new Salutation(writer);

            salutation.Exclaim();
        }