Beispiel #1
0
 private void saveAsToolStripMenuItem_Click(object sender, EventArgs e)
 {
     if (LogParser.Save())
     {
         Program.CommandLineResult = null;
         MessageBox.Show("Log Successfully Saved!");
     }
 }
Beispiel #2
0
 private void parseButton_Click(object sender, EventArgs e)
 {
     if (LogParser.Parse())
     {
         parseResultsBox.Text = "";
         parseResultsBox.Text = LogParser.buildParseTextBox();
         // 8 just sounds nice. Means something screwed up and at the least
         // there was no Keyword: added to the string.
         if (parseResultsBox.Text.Length > 8)
         {
             this.saveButton.Enabled = true;
             this.saveAsToolStripMenuItem.Enabled = true;
             Program.CommandLineFile = null;
         }
     }
 }
Beispiel #3
0
 static void Main(string[] args)
 {
     Options.Load();
     KeywordCollection.Load();
     if (args.Length > 0)
     {
         if (args.Length < 3)
         {
             MessageBox.Show("You must provide at least a Keyword List, Input File, and Output File.");
             Application.Exit();
             return;
         }
         if (Program.Keys.KeywordDict.ContainsKey(args[0].ToString()))
         {
             Program.Keys.CurrentList = args[0];
         }
         else
         {
             MessageBox.Show("Keyword List does not exist in Keywords.XML.");
             Application.Exit();
             return;
         }
         if (File.Exists(args[1].ToString()))
         {
             Program.CommandLineFile = args[1].ToString();
         }
         else
         {
             MessageBox.Show("Log File does not exist.");
             Application.Exit();
             return;
         }
         if (File.Exists(args[2].ToString()))
         {
             MessageBox.Show("Results File already exists! Appending Date....");
             string TDate = DateTime.Now.ToFileTime().ToString();
             Program.CommandLineResult = args[2].Insert((args[2].Length - 4), TDate).ToString();
         }
         else
         {
             Program.CommandLineResult = args[2].ToString();
         }
         if (args.Length > 3)
         {
             try
             {
                 Program.opt.CaseParse = bool.Parse(args[3].ToString());
             }
             catch (FormatException)
             {
                 MessageBox.Show("Case Sensitive flag passed was not True or False!");
                 Application.Exit();
                 return;
             }
         }
         // now let's parse this bad boy!
         if (LogParser.Parse())
         {
             // We build this here because of the save handling
             // to populate the LogResults Stream.
             LogParser.buildParseTextBox();
             LogParser.Save();
         }
         Application.Exit();
         return;
     }
     Application.EnableVisualStyles();
     Application.SetCompatibleTextRenderingDefault(false);
     Application.Run(new POLLogParserForm());
     Options.Save();
 }