public override void Intercept(IInvocation invocation)
{
if (Preferences.Log) {
try {
if (invocation.TargetType.IsSubclassOf(typeof(UiaCommand))) {
var cmdlet =
(invocation.InvocationTarget as UiaCommand).Cmdlet;
var logger =
AutomationFactory.GetLogHelper(string.Empty);
logger.LogCmdlet(cmdlet);
}
}
catch (Exception) {
// Console.WriteLine(eLoggingAspect.Message);
}
}
invocation.Proceed();
}
}