本文整理汇总了C#中BehaviorChain.InputType方法的典型用法代码示例。如果您正苦于以下问题:C# BehaviorChain.InputType方法的具体用法?C# BehaviorChain.InputType怎么用?C# BehaviorChain.InputType使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BehaviorChain
的用法示例。
在下文中一共展示了BehaviorChain.InputType方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: 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: ExemptedFromAuthentication
public static bool ExemptedFromAuthentication(BehaviorChain chain)
{
if (chain.InputType() != null && chain.InputType().HasAttribute<NotAuthenticatedAttribute>()) return true;
if (chain.OfType<ActionCall>().Any(x => x.HasAttribute<NotAuthenticatedAttribute>())) return true;
// TODO -- Come up with a better way of doing this
if (chain.OfType<ActionCall>().Any(x => x.HandlerType.Name == "AssetWriter")) return true;
return false;
}
示例4: WriteBody
public void WriteBody(BehaviorChain chain, HtmlTag row, HtmlTag cell)
{
Type inputType = chain.InputType();
if (inputType == null)
{
cell.Text(" -");
}
else
{
cell.Text(inputType.Name).Title(inputType.AssemblyQualifiedName);
}
}
示例5: attachMediaHandling
private void attachMediaHandling(BehaviorChain chain, IConfigurationObserver observer)
{
var firstAction = chain.FirstCall();
if (firstAction == null) return;
observer.RecordCallStatus(firstAction, "Meets criteria {0} for Conneg".ToFormat(_description));
var node = new ConnegNode(){
InputType = chain.InputType(),
OutputType = chain.Calls.Where(x => x.HasOutput).Select(x => x.OutputType()).LastOrDefault()
};
firstAction.AddBefore(node);
}
示例6: uses_the_first_may_have_input_with_non_null
public void uses_the_first_may_have_input_with_non_null()
{
var chain = new BehaviorChain();
chain.AddToEnd(new FakeInputNode(typeof (string)));
chain.InputType().ShouldEqual(typeof (string));
chain.Prepend(new FakeInputNode(null));
chain.InputType().ShouldEqual(typeof (string));
chain.Prepend(new FakeInputNode(typeof(int)));
chain.InputType().ShouldEqual(typeof(int));
}
示例7: Text
public string Text(BehaviorChain chain)
{
Type inputType = chain.InputType();
return inputType == null ? " -" : "{0} ({1})".ToFormat(inputType.Name, inputType.FullName);
}
示例8: Matches
public bool Matches(BehaviorChain chain)
{
return chain.InputType() != null;
}