コード例 #1
0
        public ControllerActionDisplay(ControllerActionConfig controllerActionConfig)
        {
            PrimaryUrl     = controllerActionConfig.PrimaryUrl;
            ControllerType = StripAllUpToAndIncludingTheLastDot(controllerActionConfig.ControllerType.ToString());
            ActionFunc     = controllerActionConfig.ActionDelegate.ToString();
            InputType      = ""; // StripAllUpToAndIncludingTheLastDot(controllerActionConfig.InputType.ToString());
            OutputType     = ""; //StripAllUpToAndIncludingTheLastDot(controllerActionConfig.OutputType.ToString());

            var actionName = StripAllUpToAndIncludingTheLastDot(ActionFunc);
            var parenLoc   = actionName.IndexOf("(");

            if (parenLoc >= 0)
            {
                actionName = actionName.Substring(0, parenLoc);
            }
            MethodSignature = "public {0} {1}({0} object);".ToFormat(OutputType, actionName, InputType);

            var behaviors = new List <DebugSingleLineDisplay>();

            controllerActionConfig.GetBehaviors().Each(b => behaviors.Add(new DebugSingleLineDisplay(b.ToString())));
            Behaviors = behaviors;

            var otherUrls = new List <DebugSingleLineDisplay>();

            controllerActionConfig.GetOtherUrls().Each(u => otherUrls.Add(new DebugSingleLineDisplay(u)));
            OtherUrls     = otherUrls;
            ShowOtherUrls = (OtherUrls.Count != 0);
        }
コード例 #2
0
        public ControllerActionDisplay(ControllerActionConfig controllerActionConfig)
        {
            PrimaryUrl = controllerActionConfig.PrimaryUrl;
            ControllerType = StripAllUpToAndIncludingTheLastDot(controllerActionConfig.ControllerType.ToString());
            ActionFunc = controllerActionConfig.ActionDelegate.ToString();
            InputType = ""; // StripAllUpToAndIncludingTheLastDot(controllerActionConfig.InputType.ToString());
            OutputType = "";  //StripAllUpToAndIncludingTheLastDot(controllerActionConfig.OutputType.ToString());

            var actionName = StripAllUpToAndIncludingTheLastDot(ActionFunc);
            var parenLoc = actionName.IndexOf("(");
            if( parenLoc >= 0 )
            {
                actionName = actionName.Substring(0, parenLoc );
            }
            MethodSignature = "public {0} {1}({0} object);".ToFormat(OutputType, actionName, InputType);

            var behaviors = new List<DebugSingleLineDisplay>();
            controllerActionConfig.GetBehaviors().Each(b => behaviors.Add(new DebugSingleLineDisplay(b.ToString())));
            Behaviors = behaviors;

            var otherUrls = new List<DebugSingleLineDisplay>();
            controllerActionConfig.GetOtherUrls().Each(u => otherUrls.Add(new DebugSingleLineDisplay(u)));
            OtherUrls = otherUrls;
            ShowOtherUrls = (OtherUrls.Count != 0);
        }