using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Trigger.Tasks.Plugins
{
///
/// Logs all events from command line
///
class LogCommandLineEvents : TaskPlugin
{
#region Properties
internal Main Main;
internal Log Log;
#endregion
#region Methods
public override bool Init(Main Main)
{
return Init(Main, new System.Diagnostics.Stopwatch());
}
public override bool Init(Main Main, System.Diagnostics.Stopwatch swInit)
{
this.Main = Main;
this.Log = Main.Log;
Main.CommandLineTrigger += new Events.EventPlugin.EventValue(Main_CommandLineTrigger);
return true;
}
public override void Dispose()
{
Main.CommandLineTrigger -= new Events.EventPlugin.EventValue(Main_CommandLineTrigger);
}
#endregion
#region Event handlers
private void Main_CommandLineTrigger(object sender, Events.EventArgsValue e)
{
this.Log.LogLineDate("Trigger from command line: 0x" + e.Value.ToString("X4"), Trigger.Log.Type.CommandLineEvent);
}
#endregion
}
}