本文整理汇总了C#中ICall.Target方法的典型用法代码示例。如果您正苦于以下问题:C# ICall.Target方法的具体用法?C# ICall.Target怎么用?C# ICall.Target使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ICall
的用法示例。
在下文中一共展示了ICall.Target方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Handle
public RouteAction Handle(ICall call)
{
var target = call.Target();
var callSpec = _callSpecificationFactory.CreateFrom(call, MatchArgs.AsSpecifiedInCall);
_context.AddToQuery(target, callSpec);
return RouteAction.Continue();
}
示例2: FormatCall
private string FormatCall(ICall call, bool isAcrossMultipleTargets, TypeInstanceNumberLookup instanceLookup)
{
var s = _callFormatter.Format(call.GetMethodInfo(), FormatArgs(call.GetArguments()));
if (!isAcrossMultipleTargets) return s;
var target = call.Target();
var methodInfo = call.GetMethodInfo();
return FormatCallForInstance(instanceLookup, target, methodInfo, s);
}
示例3: CreateCallToPropertyGetterFromSetterCall
public ICall CreateCallToPropertyGetterFromSetterCall(ICall callToSetter)
{
var propertyInfo = GetPropertyFromSetterCallOrNull(callToSetter);
if (!PropertySetterExistsAndHasAGetMethod(propertyInfo))
{
throw new InvalidOperationException("Could not find a GetMethod for \"" + callToSetter.GetMethodInfo() + "\"");
}
var getter = propertyInfo.GetGetMethod();
return new CallToPropertyGetter(getter, callToSetter.Target());
}
示例4: CreateCallToPropertyGetterFromSetterCall
public ICall CreateCallToPropertyGetterFromSetterCall(ICall callToSetter)
{
var propertyInfo = GetPropertyFromSetterCallOrNull(callToSetter);
if (!PropertySetterExistsAndHasAGetMethod(propertyInfo))
{
throw new InvalidOperationException("Could not find a GetMethod for \"" + callToSetter.GetMethodInfo() + "\"");
}
var setterArgs = callToSetter.GetArguments();
var getter = propertyInfo.GetGetMethod();
var getterArgs = setterArgs.Take(setterArgs.Length - 1).ToArray();
return new Call(getter, getterArgs, callToSetter.Target(), callToSetter.GetArgumentSpecifications());
}
示例5: Matches
private bool Matches(ICall call, CallSpecAndTarget specAndTarget)
{
return ReferenceEquals(call.Target(), specAndTarget.Target)
&& specAndTarget.CallSpecification.IsSatisfiedBy(call);
}