當前位置: 首頁>>代碼示例>>C#>>正文


C# ActionCall.Trace方法代碼示例

本文整理匯總了C#中ActionCall.Trace方法的典型用法代碼示例。如果您正苦於以下問題:C# ActionCall.Trace方法的具體用法?C# ActionCall.Trace怎麽用?C# ActionCall.Trace使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在ActionCall的用法示例。


在下文中一共展示了ActionCall.Trace方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: Attach

        public virtual void Attach(IViewProfile viewProfile, ViewBag bag, ActionCall action)
        {
            // No duplicate views!
            var outputNode = action.ParentChain().Output;
            if (outputNode.HasView(viewProfile.ConditionType)) return;

            var log = new ViewAttachmentLog(viewProfile);
            action.Trace(log);

            foreach (var filter in _filters)
            {
                var viewTokens = filter.Apply(action, bag);
                var count = viewTokens.Count();

                if (count > 0)
                {
                    log.FoundViews(filter, viewTokens.Select(x => x.Resolve()));
                }

                if (count != 1) continue;

                var token = viewTokens.Single().Resolve();
                outputNode.AddView(token, viewProfile.ConditionType);

                break;
            }
        }
開發者ID:jorferreira,項目名稱:fubumvc,代碼行數:27,代碼來源:ViewAttacher.cs

示例2: Matches

        public virtual bool Matches(ActionCall call)
        {
            if (!IsHandlerCall(call))
            {
                return false;
            }

            call.Trace("Matched on {0}", GetType().Name);

            return true;
        }
開發者ID:RobertTheGrey,項目名稱:FubuMVC.HandlerConventions,代碼行數:11,代碼來源:HandlersUrlPolicy.cs

示例3: Alter

        public static void Alter(IRouteDefinition route, ActionCall call)
        {
            var properties = call.HasInput
                                 ? new TypeDescriptorCache().GetPropertiesFor(call.InputType()).Keys
                                 : new string[0];

            Alter(route, call.Method.Name, properties, text => call.Trace(text));

            if (call.HasInput)
            {
                route.ApplyInputType(call.InputType());
            }
        }
開發者ID:aluetjen,項目名稱:fubumvc,代碼行數:13,代碼來源:MethodToUrlBuilder.cs

示例4: Matches

        public bool Matches(ActionCall call)
        {
            var result = call.InputType() == _inputType;

            if (result && _foundCallAlready)
            {
                throw new FubuException(1003,
                                        "Cannot make input type '{0}' the default route as there is more than one action that uses that input type. Either choose a input type that is used by only one action, or use the other overload of '{1}' to specify the actual action method that will be called by the default route.",
                                        _inputType.Name,
                                        ReflectionHelper.GetMethod<RouteConventionExpression>(r => r.HomeIs<object>()).
                                            Name
                    );
            }

            if (result) _foundCallAlready = true;

            if (result)
            {
                call.Trace("Action '{0}' is the default route since its input type is {1} which was specified in the configuration as the input model for the default route", call.Method.Name, _inputType.Name);
            }

            return result;
        }
開發者ID:mtscout6,項目名稱:fubumvc,代碼行數:23,代碼來源:DefaultRouteInputTypeBasedUrlPolicy.cs


注:本文中的ActionCall.Trace方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。