本文整理汇总了C#中ActionCall.Trace方法的典型用法代码示例。如果您正苦于以下问题:C# ActionCall.Trace方法的具体用法?C# ActionCall.Trace怎么用?C# ActionCall.Trace使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ActionCall
的用法示例。
在下文中一共展示了ActionCall.Trace方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Attach
public virtual void Attach(IViewProfile viewProfile, ViewBag bag, ActionCall action)
{
// No duplicate views!
var outputNode = action.ParentChain().Output;
if (outputNode.HasView(viewProfile.ConditionType)) return;
var log = new ViewAttachmentLog(viewProfile);
action.Trace(log);
foreach (var filter in _filters)
{
var viewTokens = filter.Apply(action, bag);
var count = viewTokens.Count();
if (count > 0)
{
log.FoundViews(filter, viewTokens.Select(x => x.Resolve()));
}
if (count != 1) continue;
var token = viewTokens.Single().Resolve();
outputNode.AddView(token, viewProfile.ConditionType);
break;
}
}
示例2: Matches
public virtual bool Matches(ActionCall call)
{
if (!IsHandlerCall(call))
{
return false;
}
call.Trace("Matched on {0}", GetType().Name);
return true;
}
示例3: Alter
public static void Alter(IRouteDefinition route, ActionCall call)
{
var properties = call.HasInput
? new TypeDescriptorCache().GetPropertiesFor(call.InputType()).Keys
: new string[0];
Alter(route, call.Method.Name, properties, text => call.Trace(text));
if (call.HasInput)
{
route.ApplyInputType(call.InputType());
}
}
示例4: Matches
public bool Matches(ActionCall call)
{
var result = call.InputType() == _inputType;
if (result && _foundCallAlready)
{
throw new FubuException(1003,
"Cannot make input type '{0}' the default route as there is more than one action that uses that input type. Either choose a input type that is used by only one action, or use the other overload of '{1}' to specify the actual action method that will be called by the default route.",
_inputType.Name,
ReflectionHelper.GetMethod<RouteConventionExpression>(r => r.HomeIs<object>()).
Name
);
}
if (result) _foundCallAlready = true;
if (result)
{
call.Trace("Action '{0}' is the default route since its input type is {1} which was specified in the configuration as the input model for the default route", call.Method.Name, _inputType.Name);
}
return result;
}