-
Notifications
You must be signed in to change notification settings - Fork 2
/
Program.cs
55 lines (44 loc) · 1.15 KB
/
Program.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
using System;
using System.IO;
using static Ox.BizTalk.TrackedMessageExtractor.ConsoleTools;
namespace Ox.BizTalk.TrackedMessageExtractor
{
class Program
{
static void Main(string[] args)
{
Console.WriteLine("BizTalk Bulk Tracked Message Extractor");
Console.WriteLine("Copyright (C) Alastair Grant. 2013.");
Console.WriteLine("======================================\n");
Settings settings = new Settings();
try
{
if (settings.ProcessArguments(args)) // Handle program arguments
{
settings.PromptForMissing(); // Fill in the blanks
using (StreamReader sr = new StreamReader(new FileStream(settings.InFile, FileMode.Open, FileAccess.Read)))
{
Extractor extractor = new Extractor(settings);
string line;
while ((line = sr.ReadLine()) != null)
{
if (line.Trim().Length > 0)
{
extractor.ExtractMessage(line);
}
}
}
}
}
catch(Exception ex)
{
WriteError(ex);
}
if (!settings.QuitWhenDone)
{
WriteColourful(ConsoleColor.Green, "Program Complete. Press ENTER to end...");
Console.ReadLine();
}
}
}
}