本文整理汇总了C#中IParameters.Default方法的典型用法代码示例。如果您正苦于以下问题:C# IParameters.Default方法的具体用法?C# IParameters.Default怎么用?C# IParameters.Default使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IParameters
的用法示例。
在下文中一共展示了IParameters.Default方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetTargets
public static object GetTargets(IParameters parameters)
{
var git = new GitCheckout {
Repository = @"C:\Users\Public\Documents\Development\BigSolution.git",
Directory = "one"
};
var solution = new VisualStudioSolution {
SolutionPath = git.Files["BigSolution.sln"]
};
var webProject = solution.Projects[parameters.Default("proj", "BigSolution")];
var serviceName = parameters.Default("svc", "BigWindowsService");
var service = solution.Projects[serviceName];
return new {
WebSite = new Iis7WebSite {
Directory = webProject.ProjectDirectory,
Name = "BigWebSite",
Port = 5001
},
Tests = new NUnitTests {
DllPaths = solution.Projects.Select(p => p.OutputFile)
},
Service = new WindowsService {
BinaryPath = service.OutputFile,
Name = serviceName,
DisplayName = "Big Windows Service",
Description = "a big windows service demonstrating the bounce build framework"
},
Zip = new ZipFile {
Directory = webProject.WhenBuilt(() => Path.GetDirectoryName(webProject.OutputFile.Value)),
ZipFileName = "web.zip"
},
};
}
示例2: 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,
};
}
示例3: Targets
public static object Targets(IParameters parameters)
{
var solution = new VisualStudioSolution {
SolutionPath = "WebSolution.sln",
};
var webProject = solution.Projects["WebSite"];
return new {
WebSite = new Iis7WebSite {
Directory = webProject.ProjectDirectory,
Name = "My Website",
Port = parameters.Default("port", 5001),
},
Tests = new NUnitTests {
DllPaths = solution.Projects.Select(p => p.OutputFile),
},
};
}
示例4: GetTargets
public static object GetTargets(IParameters parameters)
{
var stage = parameters.Default("stage", "packageDeploy");
var solution = new VisualStudioSolution {SolutionPath = "Solution.sln"};
var machines = new[] {
new DeployMachine {
LocalPath = @"c:\Deployments",
Machine = "liveserver1",
RemotePath = @"\\liveserver1\Deployments"
},
new DeployMachine {
LocalPath = @"c:\Deployments",
Machine = "liveserver2",
RemotePath = @"\\liveserver2\Deployments"
}
};
var targets = new StagedDeployTargetBuilder(stage);
var website = targets.CreateTarget("WebSite");
website.Package = new Copy {
FromPath = solution.Projects["WebSite"].ProjectDirectory,
ToPath = new CleanDirectory {Path = "package"}.Path.SubPath("WebSite")
}.ToPath;
website.InvokeRemoteDeploy = website.CopyToAndInvokeOnMachines(machines, new SubBounceFactory());
website.Deploy = package => new Iis7WebSite {
Directory = new Copy {
FromPath = package.SubPath("WebSite"),
ToPath = @"C:\Sites\WebSite"
}.ToPath,
Name = "WebSite"
};
return targets.Targets;
}