本文整理汇总了C#中BehaviorChain.ResourceType方法的典型用法代码示例。如果您正苦于以下问题:C# BehaviorChain.ResourceType方法的具体用法?C# BehaviorChain.ResourceType怎么用?C# BehaviorChain.ResourceType使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BehaviorChain
的用法示例。
在下文中一共展示了BehaviorChain.ResourceType方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ShouldApply
public static bool ShouldApply(BehaviorChain chain)
{
// TODO -- Get the BehaviorChainFilter thing going again?
if ( (chain.GetRoutePattern() ?? string.Empty).Contains(DiagnosticUrlPolicy.DIAGNOSTICS_URL_ROOT) )
{
return false;
}
if (chain.Calls.Any(x => x.HandlerType.Assembly == DiagnosticAssembly))
{
return false;
}
if (chain.Calls.Any(x => x.HasAttribute<NoDiagnosticsAttribute>()))
{
return false;
}
if (chain.InputType() != null && chain.InputType().Assembly == DiagnosticAssembly)
{
return false;
}
if (chain.ResourceType() != null && chain.ResourceType().Assembly == DiagnosticAssembly)
{
return false;
}
return true;
}
示例2: applyOutputs
protected override DoNext applyOutputs(IOutputNode node, BehaviorChain chain, ConnegSettings settings)
{
if (chain.ResourceType().CanBeCastTo<HtmlTag>() || chain.ResourceType().CanBeCastTo<HtmlDocument>())
{
node.Add(typeof(HtmlStringWriter<>));
return DoNext.Stop;
}
return DoNext.Continue;
}
示例3: IsNotDiagnosticRoute
public static bool IsNotDiagnosticRoute(BehaviorChain chain)
{
if (chain is DiagnosticChain) return false;
if (chain.Calls.Any(x => x.HandlerType.Assembly == Assembly.GetExecutingAssembly()))
{
return false;
}
if (chain.Calls.Any(x => x.HasInput && x.InputType().Assembly == Assembly.GetExecutingAssembly()))
{
return false;
}
if (chain.HasOutput() && chain.ResourceType().Assembly == Assembly.GetExecutingAssembly())
{
return false;
}
if (chain.HasOutput())
{
if (chain.Output.Writers.OfType<ViewNode>().Any(x => x.View.Namespace.Contains("Visualization.Visualizers")))
{
return false;
}
}
return true;
}
示例4: applyOutputs
protected override DoNext applyOutputs(IOutputNode node, BehaviorChain chain, ConnegSettings settings)
{
if (!chain.ResourceType().CanBeCastTo<AjaxContinuation>()) return DoNext.Continue;
node.Add(typeof(AjaxContinuationWriter<>));
return DoNext.Stop;
}
示例5: applyInputs
protected override DoNext applyInputs(IInputNode node, BehaviorChain chain, ConnegSettings settings)
{
if (!chain.ResourceType().CanBeCastTo<AjaxContinuation>()) return DoNext.Continue;
node.Add(typeof(ModelBindingReader<>));
node.Add(settings.FormatterFor(MimeType.Json));
return DoNext.Stop;
}
示例6: applyOutputs
protected override DoNext applyOutputs(IOutputNode node, BehaviorChain chain, ConnegSettings settings)
{
if (chain.ResourceType() == typeof (string))
{
node.Add(new StringWriter());
return DoNext.Stop;
}
return base.applyOutputs(node, chain, settings);
}
示例7: IsNotDiagnosticRoute
public static bool IsNotDiagnosticRoute(BehaviorChain chain)
{
if (chain.Route != null)
{
if (chain.Route.Pattern.Contains("_data/" + typeof(RequestLog).Name)) return false;
if (chain.Route.Pattern.Contains("_data/" + typeof(RouteReport).Name)) return false;
return !chain.Route.Pattern.Contains(DiagnosticsRegistration.DIAGNOSTICS_URL_ROOT);
}
// TODO -- figure out how to do this again
// if (chain.As<ITracedModel>().AllEvents().OfType<ChainImported>().Any(x => x.Source.ProvenanceChain.OfType<ServiceRegistryProvenance>().Any(x => x.))
// {
// return false;
// }
if (chain.Calls.Any(x => x.HandlerType.Assembly == Assembly.GetExecutingAssembly()))
{
return false;
}
if (chain.Calls.Any(x => x.HasInput && x.InputType().Assembly == Assembly.GetExecutingAssembly()))
{
return false;
}
if (chain.HasOutput() && chain.ResourceType().Assembly == Assembly.GetExecutingAssembly())
{
return false;
}
if (chain.HasOutput())
{
if (chain.Output.Writers.OfType<ViewNode>().Any(x => x.View.Namespace.Contains("Visualization.Visualizers")))
{
return false;
}
}
return true;
}
示例8: WriteBody
public void WriteBody(BehaviorChain chain, HtmlTag row, HtmlTag cell)
{
var outputType = chain.ResourceType();
cell.Append(new LinkTag(outputType.Name, _examplePageUrl + "?model=" + outputType.FullName));
}
示例9: Text
public string Text(BehaviorChain chain)
{
return chain.ResourceType().Name;
}
示例10: Matches
public bool Matches(BehaviorChain chain)
{
return chain.ResourceType().CanBeCastTo<AjaxContinuation>();
}