本文整理汇总了C#中FileInfo.WaitForExit方法的典型用法代码示例。如果您正苦于以下问题:C# FileInfo.WaitForExit方法的具体用法?C# FileInfo.WaitForExit怎么用?C# FileInfo.WaitForExit使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FileInfo
的用法示例。
在下文中一共展示了FileInfo.WaitForExit方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Run
/// <summary>
/// Runs this instance.
/// </summary>
/// <param name="PushToNuget">if set to <c>true</c> [push to nuget].</param>
/// <returns>True if it runs successfully, false otherwise</returns>
public bool Run(bool PushToNuget)
{
if (!PushToNuget)
return true;
new DirectoryInfo("..\\..\\..\\UtilitiesPackages\\Packages").Create();
new DirectoryInfo("..\\..\\..\\UtilitiesPackages\\Packages").EnumerateFiles("*", System.IO.SearchOption.AllDirectories);
new FileInfo("..\\..\\..\\README.md").CopyTo(new DirectoryInfo("..\\..\\..\\UtilitiesPackages"), true).Rename("readme.txt");
foreach (FileInfo File in new DirectoryInfo("..\\..\\..\\UtilitiesPackages\\").EnumerateFiles("*.nuspec", System.IO.SearchOption.AllDirectories).Where(x => !x.Name.Contains("Documentation")))
{
new DirectoryInfo("..\\..\\..\\UtilitiesPackages\\lib").Create();
new DirectoryInfo("..\\..\\..\\UtilitiesPackages\\tools").Create();
new DirectoryInfo("..\\..\\..\\UtilitiesPackages\\content").Create();
if (!File.Name.Contains("Ironman.Default"))
new DirectoryInfo("..\\..\\..\\" + File.Name.Replace(".nuspec", "") + "\\bin\\Release").CopyTo(new DirectoryInfo("..\\..\\..\\UtilitiesPackages\\lib"));
var NugetProcess = new FileInfo("C:\\dev\\nuget\\nuget.exe").Execute(new ProcessStartInfo { Arguments = "pack \"" + File.FullName + "\"", WorkingDirectory = "..\\..\\..\\UtilitiesPackages\\Packages", CreateNoWindow = false });
NugetProcess.WaitForExit();
while (new DirectoryInfo("..\\..\\..\\UtilitiesPackages\\lib").Exists)
{
try
{
new DirectoryInfo("..\\..\\..\\UtilitiesPackages\\lib").Delete();
new DirectoryInfo("..\\..\\..\\UtilitiesPackages\\tools").Delete();
new DirectoryInfo("..\\..\\..\\UtilitiesPackages\\content").Delete();
}
catch (System.IO.IOException) { }
}
}
foreach (FileInfo File in new DirectoryInfo("..\\..\\..\\UtilitiesPackages\\").EnumerateFiles("*.nuspec", System.IO.SearchOption.AllDirectories).Where(x => x.Name.Contains("Documentation")))
{
new DirectoryInfo("..\\..\\..\\UtilitiesPackages\\lib").Create();
new DirectoryInfo("..\\..\\..\\UtilitiesPackages\\tools").Create();
new DirectoryInfo("..\\..\\..\\UtilitiesPackages\\content").Create();
new FileInfo(@"C:\Program Files\doxygen\bin\doxygen.exe")
.Execute(new ProcessStartInfo { Arguments = "\"" + File.FullName.Replace(".nuspec", ".doxy") + "\"", WorkingDirectory = "..\\..\\..\\UtilitiesPackages", CreateNoWindow = false })
.WaitForExit();
new FileInfo("C:\\dev\\nuget\\nuget.exe")
.Execute(new ProcessStartInfo { Arguments = "pack \"" + File.FullName + "\"", WorkingDirectory = "..\\..\\..\\UtilitiesPackages\\Packages", CreateNoWindow = false })
.WaitForExit();
new DirectoryInfo("..\\..\\..\\UtilitiesPackages\\lib").Delete();
new DirectoryInfo("..\\..\\..\\UtilitiesPackages\\tools").Delete();
new DirectoryInfo("..\\..\\..\\UtilitiesPackages\\content").Delete();
}
new FileInfo("..\\..\\..\\UtilitiesPackages\\readme.txt").Delete();
return true;
}