本文整理汇总了C#中Castle.Proceed方法的典型用法代码示例。如果您正苦于以下问题:C# Castle.Proceed方法的具体用法?C# Castle.Proceed怎么用?C# Castle.Proceed使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Castle
的用法示例。
在下文中一共展示了Castle.Proceed方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Intercept
public void Intercept(Castle.DynamicProxy.IInvocation invocation)
{
if (!_ignoreMethods.Contains(invocation.Method.Name))
{
if (Log) { System.Console.WriteLine("{0}.{1} {2}", invocation.TargetType.Name, invocation.Method.Name, string.Join(" ", invocation.Arguments)); }
}
invocation.Proceed();
if (!_ignoreMethods.Contains(invocation.Method.Name))
{
if (MillisecondsPause > 0) { Pause(); }
}
}
示例2: Intercept
public void Intercept(Castle.DynamicProxy.IInvocation invocation)
{
if (NHibernateUnitOfWork.Current != null || !RequiresDbConnection(invocation.MethodInvocationTarget))
{
invocation.Proceed();
return;
}
try
{
NHibernateUnitOfWork.Current = new NHibernateUnitOfWork(_sessionFactory);
NHibernateUnitOfWork.Current.BeginTransaction();
try
{
invocation.Proceed();
NHibernateUnitOfWork.Current.Commit();
}
catch
{
try
{
NHibernateUnitOfWork.Current.Rollback();
}
catch
{
}
throw;
}
}
finally
{
NHibernateUnitOfWork.Current = null;
}
}
示例3: Intercept
public void Intercept(Castle.Core.Interceptor.IInvocation invocation)
{
IMethodInterceptor[] interceptors = ObtainAdvicesForMethod(invocation.Method,
invocation.InvocationTarget, invocation.Arguments);
if (interceptors.Length == 0)
{
// Nothing to intercept.
// Get on with it!
invocation.Proceed();
return;
}
InvocationComposite alliance_invocation = new InvocationComposite(
interceptors, invocation, invocation.Arguments);
object retval = alliance_invocation.Proceed();
invocation.ReturnValue = retval;
}