Chinchilla.Integration.Features.MessageTypeFactories.CastleMessageTypeFactory.BasicInterceptor.Intercept C# (CSharp) Метод

Intercept() публичный Метод

public Intercept ( IInvocation invocation ) : void
invocation IInvocation
Результат void
            public void Intercept(IInvocation invocation)
            {
                var methodName = invocation.Method.Name;
                if (methodName.StartsWith("set_"))
                {
                    var propertyName = methodName.Substring(4);
                    properties[propertyName] = invocation.Arguments[0];
                    return;
                }

                if (methodName.StartsWith("get_"))
                {
                    var propertyName = methodName.Substring(4);
                    var value = properties[propertyName];
                    invocation.ReturnValue = value;
                    return;
                }

                throw new ArgumentException("Only works with properties");
            }
        }
CastleMessageTypeFactory.BasicInterceptor