UIAutomation.LoggingAspect.Intercept C# (CSharp) Method

Intercept() public method

public Intercept ( IInvocation invocation ) : void
invocation IInvocation
return void
        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();
        }
    }
LoggingAspect