当前位置: 首页>>代码示例>>C#>>正文


C# BehaviorChain.InputType方法代码示例

本文整理汇总了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;
        }
开发者ID:JordanZaerr,项目名称:FubuMVC.Diagnostics,代码行数:30,代码来源:ApplyTracing.cs

示例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;
        }
开发者ID:RyanHauert,项目名称:FubuMVC.Diagnostics,代码行数:29,代码来源:ChainVisualization.cs

示例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;
        }
开发者ID:jrios,项目名称:FubuMVC.Authentication,代码行数:10,代码来源:ApplyAuthenticationPolicy.cs

示例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);
            }
        }
开发者ID:RobertTheGrey,项目名称:fubumvc,代码行数:13,代码来源:InputModelColumn.cs

示例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);
        }
开发者ID:henninga,项目名称:fubumvc,代码行数:14,代码来源:ConnegBehaviorConvention.cs

示例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));
        }
开发者ID:jorferreira,项目名称:fubumvc,代码行数:13,代码来源:BehaviorChainTester.cs

示例7: Text

 public string Text(BehaviorChain chain)
 {
     Type inputType = chain.InputType();
     return inputType == null ? " -" : "{0} ({1})".ToFormat(inputType.Name, inputType.FullName);
 }
开发者ID:RobertTheGrey,项目名称:fubumvc,代码行数:5,代码来源:InputModelColumn.cs

示例8: Matches

 public bool Matches(BehaviorChain chain)
 {
     return chain.InputType() != null;
 }
开发者ID:joemcbride,项目名称:fubuvalidation,代码行数:4,代码来源:HasInputType.cs


注:本文中的BehaviorChain.InputType方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。