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


C# IParameters.Required方法代码示例

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


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

示例1: Targets

        public static object Targets(IParameters parameters)
        {
            var stage = parameters.Required<string>("stage");
            var machine = parameters.Required<string>("machine");

            var deployService = new Copy {
                FromPath = "service",
                ToPath = machine.WhenBuilt(m => String.Format(@"c:\deployments\install\{0}\service", m)),
            };
            var deployWeb = new Copy {
                FromPath = "web",
                ToPath = machine.WhenBuilt(m => String.Format(@"c:\deployments\install\{0}\web", m)),
            };

            var remoteMachineOne = GetRemoteMachine(stage, machine, "one");
            var remoteMachineTwo = GetRemoteMachine(stage, machine, "two");

            Task<IEnumerable<RemoteMachine>> serviceMachines = new[] {remoteMachineOne, remoteMachineTwo};
            Task<IEnumerable<RemoteMachine>> webMachines = new[] {remoteMachineTwo};

            var deployArchive = new StagedDeployArchive(stage, "archive");
            var service = deployArchive.Add("service", "service", deployService).WithRemoteDeploy(serviceMachines.SelectTasks(m => m.DeployTargets("Service")));
            var web = deployArchive.Add("web", "web", deployWeb).WithRemoteDeploy(webMachines.SelectTasks(m => m.DeployTargets("Web")));

            return new {
                Service = service,
                Web = web,
            };
        }
开发者ID:nbucket,项目名称:bounce,代码行数:29,代码来源:BuildTargets.cs

示例2: RealTargets

        public static object RealTargets(IParameters buildParameters)
        {
            var version = buildParameters.Required<string>("version");

            var git = new GitCheckout {
                Repository = "git://github.com/refractalize/bounce.git",
                Directory = "tmp2",
            };
            var solution = new VisualStudioSolution {
                SolutionPath = "Bounce.sln",
            };
            var frameworkProject = solution.Projects["Bounce.Framework"];

            var downloadsDir = new CleanDirectory {
                Path = "Downloads",
            };

            var frameworkZip = new ZipFile {
                Directory = frameworkProject.WhenBuilt(() => Path.GetDirectoryName(frameworkProject.OutputFile.Value)),
                ZipFileName = downloadsDir.Files[version.WhenBuilt(() => string.Format("Bounce.Framework.{0}.zip", version.Value))],
            };

            var downloads = new All(frameworkZip, new GitTag {Directory = ".", Tag = version.WhenBuilt(() => "v" + version.Value)});

            return new {
                Tests = new NUnitTests {
                    DllPaths = solution.Projects.Select(p => p.OutputFile),
                },
                Downloads = downloads,
            };
        }
开发者ID:svoruganti,项目名称:bounce,代码行数:31,代码来源:BuildTargets.cs

示例3: GetTargets

            public static object GetTargets(IParameters parameters) {
                var one = new FakeTask {Dependencies = new [] {new TaskDependency (parameters.Required<int>("port"))}};
                var two = new FakeTask {Dependencies = new [] {new TaskDependency (parameters.Default("name", "Some Web Site"))}};

                return new {
                    One = one,
                    Two = two,
                };
            }
开发者ID:nbucket,项目名称:bounce,代码行数:9,代码来源:ShowingAvailableTargetsAndParametersFeature.cs

示例4: GetTargets

            public static object GetTargets(IParameters parameters)
            {
                var machineName = parameters.Required<string>("machineName");
                var remoteOne = new PrintTask(Output) {Description = machineName};
                var two = new PrintTask(Output) {Description = parameters.Required<string>("two")};

                var remoteBounce = new RemoteBounce();

                RemoteBounceArguments remoteOneArgs = remoteBounce.ArgumentsForTargets(new { RemoteOne = remoteOne });

                Task<IEnumerable<string>> machines = new [] {"machine1", "machine2"};
                var one = machines.SelectTasks(machine => new RemoteExec {
                    BounceArguments = remoteOneArgs.WithParameter(machineName.WithValue(machine)),
                    Machine = machine,
                });

                return remoteBounce.WithRemoteTargets(new {
                    One = one,
                    Two = two,
                });
            }
开发者ID:nbucket,项目名称:bounce,代码行数:21,代码来源:RemoteBounceFeature.cs

示例5: GetTargets

            public static object GetTargets(IParameters parameters)
            {
                var one = new PrintTask(Output) { Description = parameters.Required<string>("one") };
                var two = new PrintTask(Output) { Description = parameters.Required<string>("two") };

                return new {
                    One = one,
                    Two = two,
                };
            }
开发者ID:nbucket,项目名称:bounce,代码行数:10,代码来源:BuildingATargetFeature.cs


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