static void Main(string[] args) { TextWriterModule writer = new TextWriterModule(); writer.Context = Console.Out; writer.Write(GetWelcomeMessage()); NewDatabaseEntities database = new NewDatabaseEntities(); ReportDataModule dataProcessor = new ReportDataModule(); dataProcessor.Context = database; List <Item> items = dataProcessor.Read(); ReportWriter reportWriter = new ReportWriter(); reportWriter.Context = Console.Out; reportWriter.Write(items); int count = database.Items.Count(); writer.Write(Environment.NewLine); writer.Write(String.Format("\nItems scanned: {0}", count), Environment.NewLine); Console.ReadKey(); }
static void Main(string[] args) { TextFileWriterModule fileWriter = new TextFileWriterModule(); fileWriter.Context.FileName = Properties.Settings.Default.LogFilePath; fileWriter.Context.IsAppend = true; fileWriter.Write(String.Format("{0} - Program started\n", DateTime.Now)); TextWriterModule writer = new TextWriterModule(); writer.Context = Console.Out; writer.Write(GetWelcomeMessage()); AssemblyExaminerModule examiner = new AssemblyExaminerModule(); List <String> properties = examiner.Read(Assembly.GetExecutingAssembly()); writer.Write(properties, Environment.NewLine); BrowserModule browser = new BrowserModule(); BrowserModule.Logger = fileWriter; browser.Open("http://www.microsoft.com"); fileWriter.Write(String.Format("{0} - Program stopped\n", DateTime.Now)); Console.ReadKey(); }