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


C# BehaviorChain.FirstCall方法代码示例

本文整理汇总了C#中BehaviorChain.FirstCall方法的典型用法代码示例。如果您正苦于以下问题:C# BehaviorChain.FirstCall方法的具体用法?C# BehaviorChain.FirstCall怎么用?C# BehaviorChain.FirstCall使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在BehaviorChain的用法示例。


在下文中一共展示了BehaviorChain.FirstCall方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Matches

		public bool Matches(BehaviorChain chain)
		{
			var call = chain.FirstCall();
			if (call == null) return true;

			return !call.HasAttribute<NotValidatedAttribute>() && !call.InputType().HasAttribute<NotValidatedAttribute>();
		}
开发者ID:stevematney,项目名称:fubuvalidation,代码行数:7,代码来源:NotValidatedAttributeFilter.cs

示例2: Modify

        public static void Modify(BehaviorChain chain)
        {
            // Not everything is hard
            chain.Output.Remove();

            if (chain.OfType<InputNode>().Any())
            {
                chain.Input.AddAfter(chain.Output);
            }
            else
            {
                chain.FirstCall().AddBefore(chain.Output);
            }
        }
开发者ID:NeilSorensen,项目名称:fubumvc,代码行数:14,代码来源:OutputBeforeAjaxContinuationPolicy.cs

示例3: 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

示例4: VisitRoute

        public void VisitRoute(IRouteDefinition route, BehaviorChain chain)
        {
            ActionCall action = chain.FirstCall();
            if (action == null) return;

            if (action.HasInput)
            {
                // TODO:  throw if route is null;
                var model = (IModelUrl) route;
                _registration.AddModel(model);
            }

            var actionUrl = new ActionUrl(route, action);
            _registration.AddAction(actionUrl);
        }
开发者ID:joshuaflanagan,项目名称:fubumvc,代码行数:15,代码来源:UrlRegistryBuilder.cs

示例5: ModeFor

		public FormMode ModeFor(BehaviorChain chain)
		{
			var call = chain.FirstCall();
			if (call == null || call.HasAttribute<NoFormModeAttribute>())
			{
				return FormMode.None;
			}

			if (call.HasInput && call.InputType().HasAttribute<NoFormModeAttribute>())
			{
				return FormMode.None;
			}

			var policy = policyFor(chain) ?? FormModePolicy.Default();
			return policy.ModeFor(chain);
		}
开发者ID:DarthFubuMVC,项目名称:FubuMVC.Ajax,代码行数:16,代码来源:IFormRegistry.cs

示例6: GetQuerystringParameters

        private List<QuerystringParameter> GetQuerystringParameters(BehaviorChain chain)
        {
            var action = chain.FirstCall();

            return _typeCache.GetPropertiesFor(action.InputType())
                .Where(x => x.Value.IsQuerystring(action) && 
                            !x.Value.HasAttribute<HideAttribute>() && 
                            !x.Value.IsAutoBound())
                .Select(x => {
                    var description = _memberConvention.GetDescription(x.Value);
                    return _configuration.QuerystringOverrides.Apply(chain, x.Value, new QuerystringParameter {
                        Name = description.WhenNotNull(y => y.Name).OtherwiseDefault(),
                        Comments = description.WhenNotNull(y => y.Comments).OtherwiseDefault(),
                        Type = (x.Value.PropertyType.GetListElementType() ?? x.Value.PropertyType).GetXmlName(_configuration.EnumFormat == EnumFormat.AsString),
                        Options = _optionFactory.BuildOptions(x.Value.PropertyType),
                        DefaultValue = description.DefaultValue.WhenNotNull(y => y.ToSampleValueString(_configuration)).OtherwiseDefault(),
                        MultipleAllowed = x.Value.PropertyType.IsArray || x.Value.PropertyType.IsList(),
                        Required = !description.Optional
                    });
                }).OrderBy(x => x.Name).ToList();
        }
开发者ID:mikeobrien,项目名称:FubuMVC.Swank,代码行数:21,代码来源:SpecificationService.cs

示例7: GetUrlParameters

        private List<UrlParameter> GetUrlParameters(BehaviorChain chain)
        {
            var action = chain.FirstCall();

            var properties = _typeCache.GetPropertiesFor(action.InputType());
            return action.ParentChain().Route.Input.RouteParameters.Select(
                x => {
                    var property = properties[x.Name];
                    var description = _memberConvention.GetDescription(property);
                    return _configuration.UrlParameterOverrides.Apply(chain, property, new UrlParameter {
                            Name = description.WhenNotNull(y => y.Name).OtherwiseDefault(),
                            Comments = description.WhenNotNull(y => y.Comments).OtherwiseDefault(),
                            Type = property.PropertyType.GetXmlName(_configuration.EnumFormat == EnumFormat.AsString),
                            Options = _optionFactory.BuildOptions(property.PropertyType)
                        });
                }).ToList();
        }
开发者ID:mikeobrien,项目名称:FubuMVC.Swank,代码行数:17,代码来源:SpecificationService.cs

示例8: GetRequest

        private Data GetRequest(BehaviorChain chain, EndpointDescription endpoint)
        {
            var firstCall = chain.FirstCall();
            DataType type = null;
            List<BodyLineItem> description = null;

            if (firstCall.HasInput &&
                !chain.Route.AllowsGet() &&
                !chain.Route.AllowsDelete())
            {
                type = _typeGraphFactory.BuildGraph(firstCall.InputType(), chain.FirstCall());
                description = _bodyDescriptionFactory.Create(type);
            }

            return _configuration.RequestOverrides.Apply(chain, new Data
            {
                Comments = endpoint.RequestComments,
                Headers = GetHeaders(chain, HttpDirection.Request),
                MimeTypes = GetMimeTypes(chain, HttpDirection.Request),
                Body = new Body { Type = type, Description = description }
            });
        }
开发者ID:mikeobrien,项目名称:FubuMVC.Swank,代码行数:22,代码来源:SpecificationService.cs

示例9: IsNotFubuChain

 static bool IsNotFubuChain(BehaviorChain chain)
 {
     var call = chain.FirstCall();
     if (call == null) return false;
     return call.HandlerType.Assembly != typeof (FubuRegistry).Assembly;
 }
开发者ID:mikeobrien,项目名称:FubuMVC.Swank,代码行数:6,代码来源:BehaviorSource.cs

示例10: IsNotSwankChain

 static bool IsNotSwankChain(BehaviorChain chain)
 {
     var call = chain.FirstCall();
     if (call == null) return false;
     return call.HandlerType.Assembly != typeof(BehaviorSource).Assembly;
 }
开发者ID:mikeobrien,项目名称:FubuMVC.Swank,代码行数:6,代码来源:BehaviorSource.cs

示例11: IsNotConfigThing

 bool IsNotConfigThing(BehaviorChain chain)
 {
     return (!_configuration.AppliesToAssemblies.Any() ||
             _configuration.AppliesToAssemblies.Any(y => y == chain.FirstCall().HandlerType.Assembly));
 }
开发者ID:mikeobrien,项目名称:FubuMVC.Swank,代码行数:5,代码来源:BehaviorSource.cs


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