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


C# IRequest.FindParameterStartingWith方法代码示例

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


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

示例1: Create

        public IAction Create(IRequest request)
        {
            string actionParam = request.FindParameterStartingWith(DefaultUrlBuilder.ACTION_PARAMETER_PREFIX);
            string actionName = actionParam == "" ? "" : actionParam.Substring(DefaultUrlBuilder.ACTION_PARAMETER_PREFIX.Length);;

            if (actionName == "")
            {
                return giver.GiveObjectByType(typeof(DefaultAction)) as IAction;
            }

            IAction action = giver.GiveObjectById(actionName) as IAction;

            if (action == null)
            {
                return new UnknownActionAction();
            }
            return action;
        }
开发者ID:vardars,项目名称:ci-factory,代码行数:18,代码来源:CruiseActionFactory.cs

示例2: ForceBuildIfNecessary

 private string ForceBuildIfNecessary(IRequest request)
 {
     if (request.FindParameterStartingWith("forcebuild") != string.Empty)
     {
         string forceBuildProject = request.GetText("forceBuildProject");
         bool forceWasAllowed = false;
         forceWasAllowed = farmService.ForceBuild(
             new DefaultProjectSpecifier(
                 new DefaultServerSpecifier(request.GetText("forceBuildServer")),
                 forceBuildProject));
         if (forceWasAllowed)
         {
             return string.Format("Build successfully forced for {0}", forceBuildProject);
         }
         else
         {
             return string.Format("Build was not allowed to be forced for {0}", forceBuildProject);
         }
     }
     else
     {
         return "";
     }
 }
开发者ID:vardars,项目名称:ci-factory,代码行数:24,代码来源:VelocityProjectGridAction.cs

示例3: ForceBuildIfNecessary

 private string ForceBuildIfNecessary(IRequest request, string sessionToken)
 {
     Dictionary<string, string> parameters = new Dictionary<string, string>();
     foreach (string parameterName in HttpContext.Current.Request.Form.AllKeys)
     {
         if (parameterName.StartsWith("param_"))
         {
             parameters.Add(parameterName.Substring(6), HttpContext.Current.Request.Form[parameterName]);
         }
     }
     // Make the actual call
     if (request.FindParameterStartingWith("StopBuild") != string.Empty)
     {
         farmService.Stop(ProjectSpecifier(request), sessionToken);
         return this.translations.Translate("Stopping project {0}", SelectedProject(request));
     }
     else if (request.FindParameterStartingWith("StartBuild") != string.Empty)
     {
         farmService.Start(ProjectSpecifier(request), sessionToken);
         return this.translations.Translate("Starting project {0}", SelectedProject(request));
     }
     else if (request.FindParameterStartingWith("ForceBuild") != string.Empty)
     {
         farmService.ForceBuild(ProjectSpecifier(request), sessionToken, parameters);
         return this.translations.Translate("Build successfully forced for {0}", SelectedProject(request));
     }
     else if (request.FindParameterStartingWith("AbortBuild") != string.Empty)
     {
         farmService.AbortBuild(ProjectSpecifier(request), sessionToken);
         return this.translations.Translate("Abort successfully forced for {0}", SelectedProject(request));
     }
     else
     {
         return string.Empty;
     }
 }
开发者ID:alexanderyaremchuk,项目名称:CruiseControl.NET,代码行数:36,代码来源:CategorizedFarmReportFarmPlugin.cs

示例4: ForceBuildIfNecessary

        private string ForceBuildIfNecessary(IProjectSpecifier projectSpecifier, IRequest request, string sessionToken)
        {
            // Retrieve the parameters
            var parameters = new Dictionary<string, string>();
            foreach (string parameterName in HttpContext.Current.Request.Form.AllKeys)
            {
                if (parameterName.StartsWith("param_"))
                {
                    parameters.Add(parameterName.Substring(6), HttpContext.Current.Request.Form[parameterName]);
                }
            }

            if (!string.IsNullOrEmpty(request.FindParameterStartingWith("StopBuild")))
            {
                farmService.Stop(projectSpecifier, sessionToken);
                return string.Format("Stopping project {0}", projectSpecifier.ProjectName);
            }
            else if (!string.IsNullOrEmpty(request.FindParameterStartingWith("StartBuild")))
            {
                farmService.Start(projectSpecifier, sessionToken);
                return string.Format("Starting project {0}", projectSpecifier.ProjectName);
            }
            else if (!string.IsNullOrEmpty(request.FindParameterStartingWith("ForceBuild")))
            {
                farmService.ForceBuild(projectSpecifier, sessionToken, parameters);
                return string.Format("Build successfully forced for {0}", projectSpecifier.ProjectName);
            }
            else if (!string.IsNullOrEmpty(request.FindParameterStartingWith("AbortBuild")))
            {
                farmService.AbortBuild(projectSpecifier, sessionToken);
                return string.Format("Abort successfully forced for {0}", projectSpecifier.ProjectName);
            }
            else
            {
                return string.Empty;
            }
        }
开发者ID:derrills1,项目名称:ccnet_gitmode,代码行数:37,代码来源:ProjectReportProjectPlugin.cs

示例5: SortAscending

 private bool SortAscending(IRequest request)
 {
     return request.FindParameterStartingWith("ReverseSort") == string.Empty;
 }
开发者ID:vardars,项目名称:ci-factory,代码行数:4,代码来源:VelocityProjectGridAction.cs


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