Ejemplo n.º 1
0
        static void Main(string[] args)
        {
            string writerType;           /*   */
            string outputFileFullPath;

            // Grab writer type from project settings
            writerType = Properties.Settings.Default.WriterType;

            // Grab writer type from project settings
            outputFileFullPath = Properties.Settings.Default.OutputFileFullPath; // D:\DEV\temp\myfile.txt

            // Create instance from factory method
            //Prints to console/screen
            ISimplyWrite simpleDataWriter = SimpleWriterFactory.GetWriter();

            // Prints to file
            // ISimplyWrite simpleDataWriter = SimpleWriterFactory.GetWriter(writerType, outputFileFullPath);

            simpleDataWriter.SimplyWrite();


            Console.WriteLine();
            Console.WriteLine("Press any key to continue...");
            Console.ReadLine();
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            string writerType;

            // Grab writer type from project settings
            writerType = Properties.Settings.Default.WriterType;

            // Create instance from factory method
            ISimplyWrite simpleDataWriter = SimpleWriterFactory.GetWriter(writerType);

            // Write output
            simpleDataWriter.SimplyWrite();
        }