Class to encapsulate the data we need for Adding an Event Log Entry
예제 #1
0
 public void RaiseLogAdded(AddLogEventArgs e)
 {
     LogAdded(instance, e);
 }
예제 #2
0
 public void RaiseLogAdded(AddLogEventArgs e)
 {
     LogAdded(instance, e);
 }
예제 #3
0
 /// <summary>
 /// Adds an item to our event log
 /// </summary>
 /// <param name="sender">Sending Object</param>
 /// <param name="e">Encapsulating Object with data</param>
 public void HandleItemAdded(object sender, AddLogEventArgs e)
 {
     if (processTreeView.InvokeRequired)
     {
         evtLogList.Invoke(new AddItemCallback(HandleItemAdded), new Object[] {sender, e});
     }
     else
     {
         evtLogList.BeginUpdate();
         evtLogList.AddObject(e.Entry);
         eventLogEntries.Add(e.Entry);
         evtLogList.EndUpdate();
         evtLogList.EnsureVisible(evtLogList.Items.Count - 1);
         if (PreventionMode)
         {
             icon.BalloonTipTitle = "Intrusion Prevented";
         }
         else
         {
             icon.BalloonTipTitle = "Event Detected";
         }
         icon.BalloonTipText = e.Entry.Detect;
         icon.ShowBalloonTip(3000);
         if (eventLogEntries.Count == 0)
         {
             evtLogList.AutoResizeColumns(ColumnHeaderAutoResizeStyle.HeaderSize);
         }
         else
         {
             evtLogList.AutoResizeColumns();
         }
     }
 }