本文整理汇总了C#中ICall类的典型用法代码示例。如果您正苦于以下问题:C# ICall类的具体用法?C# ICall怎么用?C# ICall使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ICall类属于命名空间,在下文中一共展示了ICall类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Handle
public RouteAction Handle(ICall call)
{
var callSpecification = _callSpecificationFactory.CreateFrom(call, _matchArgs);
if (!_receivedCalls.FindMatchingCalls(callSpecification).Any())
{
_exceptionThrower.Throw(callSpecification, GetAllReceivedCallsToMethod(call));
}
return RouteAction.Continue();
}
示例2: Handle
public RouteAction Handle(ICall call)
{
var target = call.Target();
var callSpec = _callSpecificationFactory.CreateFrom(call, MatchArgs.AsSpecifiedInCall);
_context.AddToQuery(target, callSpec);
return RouteAction.Continue();
}
示例3: action
RouteAction ICallHandler.Handle(ICall call)
{
if (!HasResultFor(call))
action();
return RouteAction.Continue();
}
示例4: NonMatchingArguments
public IEnumerable<ArgumentMatchInfo> NonMatchingArguments(ICall call)
{
var arguments = call.GetArguments();
return arguments
.Select((arg, index) => new ArgumentMatchInfo(index, arg, _argumentSpecifications[index]))
.Where(x => !x.IsMatch);
}
示例5: HandleCall
private ICode HandleCall(ICall call, Func<Expr, IEnumerable<Expr>, ICode> fnNew) {
if (call.CallMethod.Name == "DeepCopyValueType") {
// HACK
return call;
}
var obj = (Expr)this.Visit(call.Obj);
var argsInfo = call.Args.Select((arg, i) => new { arg, parameterType = call.CallMethod.Parameters[i].ParameterType }).ToArray();
var args = this.HandleList(argsInfo, argInfo => {
if (!argInfo.parameterType.IsValueType) {
return argInfo;
}
var arg = argInfo.arg;
var type = arg.Type;
if (type.IsNonPrimitiveValueType() && !type.IsRuntimeHandle() && !type.IsEnum()) {
return new { arg = InternalFunctions.ValueTypeDeepCopyIfRequired(arg.Type, () => arg) ?? arg, parameterType = argInfo.parameterType };
} else {
return argInfo;
}
}).NullThru(x => x.Select(y => y.arg).ToArray());
if (obj != call.Obj || args != null) {
return fnNew(obj, args ?? call.Args);
} else {
return call;
}
}
示例6: IsSatisfiedBy
public bool IsSatisfiedBy(ICall call)
{
if (_methodInfo != call.GetMethodInfo()) return false;
if (HasDifferentNumberOfArguments(call)) return false;
if (NonMatchingArguments(call).Any()) return false;
return true;
}
示例7: GetResult
public object GetResult(ICall call)
{
return _results
.Reverse()
.First(x => x.IsResultFor(call))
.GetResult(_callInfoFactory.Create(call));
}
示例8: IsTriggered
public bool IsTriggered(ICall call, DateTime triggerDate)
{
if( new TimeSpan(triggerDate.Ticks - call.Date.Ticks).TotalMilliseconds >= _delay)
return true;
return false;
}
示例9: Handle
public RouteAction Handle(ICall call)
{
var callSpec = _callSpecificationFactory.CreateFrom(call, MatchArgs.AsSpecifiedInCall);
_pendingCallSpecification.Set(callSpec);
_callActions.Add(callSpec);
return RouteAction.Continue();
}
示例10: op_Equality
public static Expr op_Equality(ICall call) {
var ctx = call.Ctx;
var a = call.Args.ElementAt(0);
var b = call.Args.ElementAt(1);
var expr = new ExprBinary(ctx, BinaryOp.Equal, ctx.Boolean, a, b);
return expr;
}
示例11: Expect
public void Expect( ICall call )
{
if ( expectedCalls == null )
expectedCalls = new ArrayList();
expectedCalls.Add( call );
}
示例12: TriggeredExecution
public bool TriggeredExecution(ICall call)
{
foreach(ITrigger trigger in _triggers)
{
if(!trigger.IsTriggered(call, DateTime.Now))
return false;
}
_log.Info("Actionpack '{0}' is triggered for call '{1}'", _name, call);
foreach(IAction action in _actions)
{
try
{
_log.Info("started action '{0}'", action.GetType());
action.Execute(call);
_log.Info("Completed action '{0}'", action.GetType());
}
catch(Exception e)
{
_log.ErrorException(string.Format("Error executing action '{0}'",action.GetType()), e);
}
}
return true;
}
示例13: OnFailure
public void OnFailure(ICall call, Java.IO.IOException exception)
{
if (onFailure != null)
{
onFailure(call, exception);
}
}
示例14: OnResponse
public void OnResponse(ICall call, Response response)
{
if (onResponse != null)
{
onResponse(call, response);
}
}
示例15: InvokeMatchingActions
public void InvokeMatchingActions(ICall call)
{
var callInfo = _callInfoFactory.Create(call);
foreach (var action in _actions.Where(x => x.IsSatisfiedBy(call)))
{
action.Invoke(callInfo);
}
}