本文整理汇总了C#中BehaviorChain.HasOutput方法的典型用法代码示例。如果您正苦于以下问题:C# BehaviorChain.HasOutput方法的具体用法?C# BehaviorChain.HasOutput怎么用?C# BehaviorChain.HasOutput使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BehaviorChain
的用法示例。
在下文中一共展示了BehaviorChain.HasOutput方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: 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;
}
示例2: TitleForChain
public static string TitleForChain(BehaviorChain chain)
{
if (chain.GetRoutePattern().IsNotEmpty())
{
return chain.GetRoutePattern();
}
if (chain.GetRoutePattern() == string.Empty)
{
return "(home)";
}
if (chain.Calls.Any())
{
return chain.Calls.Select(x => x.Description).Join(", ");
}
if (chain.HasOutput() && chain.Output.Writers.Any())
{
return chain.Output.Writers.Select(x => Description.For(x).Title).Join(", ");
}
if (chain.InputType() != null)
{
return "Handler for " + chain.InputType().FullName;
}
return "BehaviorChain " + chain.UniqueId;
}
示例3: 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;
}
示例4: has_output_depends_on_the_output_node_now
public void has_output_depends_on_the_output_node_now()
{
var chain = new BehaviorChain();
chain.AddToEnd(ActionCall.For<OneController>(x => x.Query(null)));
chain.HasOutput().ShouldBeFalse();
chain.Output.AddFormatter<JsonFormatter>();
chain.HasOutput().ShouldBeTrue();
}