private void btnCreateVen_ClickAsync(object sender, EventArgs e) { if (txtNumberVen.Text == "" || txtNumLoads.Text == "") { MessageBox.Show("Data input is not valid !"); return; } var settings = new IniFile("Settings.ini"); // settings.Write("VEN Name", txtvenID.Text, "Ven Settings"); // settings.Write("VEN ID", txtVenName.Text, "Ven Settings"); settings.Write("URL", txtUrl.Text, "Ven Settings"); settings.Write("MaxVen", txtNumberVen.Text, "Ven Settings"); settings.Write("MaxLoads", txtNumLoads.Text, "Ven Settings"); settings.Write("HideVen", chkHidevens.Checked.ToString(), "Ven Settings"); settings.Write("MaxThread", txtMaxthread.Text, "Ven Settings"); var Path = AppDomain.CurrentDomain.BaseDirectory + "/VenCenter.exe"; var res = ProcessAsyncHelper.RunProcessAsync(Path, "start -n " + txtNumberVen.Text + " -l " + txtNumLoads.Text + " -t " + txtMaxthread.Text + (chkHidevens.Checked ? "":" -s"), 3 * 60 * 1000).ConfigureAwait(false); this.Close(); }
private async void Compile(Action func) { String generatedSourceFile = Path.Combine(new FileInfo(Mapset.Path).Directory.FullName, "maps.asm"); ASM.Export(generatedSourceFile, AsmBaseLineFullPath, Mapset); AddLine($"{Environment.NewLine}**Generating {GetXEXFullPath()} **{Environment.NewLine}", Color.Red); String arguments = $"-i:\"{Path.GetDirectoryName(generatedSourceFile)}\" \"{generatedSourceFile}\" -o:\"{GetXEXFullPath()}\""; if (firstmap > 0) { arguments += $" -d:BLCK_MAPSTART={firstmap}"; } AddLine(arguments, Color.Red); var processResult = await ProcessAsyncHelper.RunProcessAsync(MADSFullPath, arguments, -1, P_OutputDataReceived, p_ErrorDataReceived); // Mads Exit codes // 3 = bad parameters, assembling not started // 2 = error occured // 0 = no errors buttonOK.Enabled = true; if (processResult.ExitCode == 0) { func(); } }
private void button2_Click(object sender, EventArgs e) { var Path = AppDomain.CurrentDomain.BaseDirectory + "/VenCenter.exe"; var res = ProcessAsyncHelper.RunProcessAsync(Path, "stop -all ", 3 * 60 * 1000).ConfigureAwait(false); this.Close(); }
public async Task <ProcessResult> GenerateServerCode(string rootWebAPIProjectNameSuffix, CodeGenConfig config) { var jsonfile = config.SwaggerFile; var strJarFilePath = Directory.GetCurrentDirectory() + "\\" + SWAGGER_CODEGEN_JAR; var mustacheTemplatePath = Directory.GetCurrentDirectory() + @"\SwaggerCodeGen\AspDotNetCoreMustacheTemplate"; var rootApiProjectName = config.PackageName + "." + rootWebAPIProjectNameSuffix; return(await ProcessAsyncHelper.RunProcessAsync("java.exe", $"-jar {strJarFilePath} generate -i {jsonfile} -t {mustacheTemplatePath} -DpackageName={rootApiProjectName} -l aspnetcore -o {config.outputFolderPath}", 30000).ConfigureAwait(false)); }
public ProgressDialog(string arg) { Instance = this; // 다운로드 실행 var youtubeDl = ((App)Application.Current).YoutubeDlPath; process = ProcessAsyncHelper.RunProcessAsync(youtubeDl, arg, int.MaxValue); InitializeComponent(); }
static async void OnPostprocessAllAssets( string[] importedAssets, string[] deletedAssets, string[] movedAssets, string[] movedFromAssetPaths) { var pugFilePaths = importedAssets .Where(filePath => filePath.Split('.')[1] == "pug"); foreach (var filePath in pugFilePaths) { var fileName = filePath.Split('.')[0]; var dataPath = Application.dataPath.Replace("/Assets", ""); var args = $"{dataPath}/{fileName}.pug -P"; var process = ProcessAsyncHelper.RunProcessAsync( Pug, args, 1000, (PathName, PathPath)); await process; // When it's done, insert the UIElements boilerplate var tempOutput = File.ReadAllText(fileName + ".html"); var insertIndex = tempOutput.IndexOf("<UXML", StringComparison.Ordinal); var uxmlString = tempOutput.Insert(insertIndex + 5, " xmlns:xsi=\"http:/www.w3.org/2001/XMLSchema-instance\"" + " xmlns=\"UnityEngine.UIElements\"" + " xsi:noNamespaceSchemaLocation=\"../UIElementsSchema/UIElements.xsd\"" + " xsi:schemaLocation=\"UnityEngine.UIElements ../UIElementsSchema/UnityEngine.UIElements.xsd\""); File.Delete(fileName + ".html"); var uxmlDoc = new XmlDocument(); uxmlDoc.LoadXml(uxmlString); var settings = new XmlWriterSettings { Indent = true }; // Save the document to a file and auto-indent the output. var writer = XmlWriter.Create(fileName + ".uxml", settings); uxmlDoc.Save(writer); writer.Dispose(); } }
private void GenerateRelease() { Compile(async() => { String ExomizerFullPath = Properties.Settings.Default["ExomizerFullPath"].ToString(); String EmulatorCommandLine = Properties.Settings.Default["EmulatorCommandLine"].ToString(); if (File.Exists(ExomizerFullPath)) { var maxAdr = XEX.Load(GetXEXFullPath()).GetMaxAdr() + 2; var arguments = $"sfx sys -x3 \"{GetXEXFullPath()}\" -Di_table_addr={maxAdr} -t 168 -o \"{GetPackedXEXFullPath()}\""; AddLine($"{Environment.NewLine}** {arguments} **{Environment.NewLine}", Color.Red); var processResult = await ProcessAsyncHelper.RunProcessAsync(ExomizerFullPath, arguments, -1, P_OutputDataReceived, p_ErrorDataReceived); // DialogResult = DialogResult.OK; } }); }
public async Task <IAnalysis> AnalyzeAsync(string pdfPath, IProgress <int> pageProgress = null, CancellationToken ct = default) { var p2t = GetPdfToTextExePath(); if (!File.Exists(p2t)) { throw new PopplerNotFoundException($"The file {p2t} was not found. This application needs poppler to work properly. Please download poppler and extract it at the given location. You may download poppler at {PopplerDownloadUrl}.", p2t); } var output = System.IO.Path.GetTempFileName(); var arg = $"{PdfToTextArgs} \"{pdfPath}\" \"{output}\""; var res = await ProcessAsyncHelper.RunProcessAsync(p2t, arg, PdfToTextTimeout).ConfigureAwait(false); if (res.ExitCode != 0) { throw new ApplicationException($"PdfToText exited with code {res.ExitCode?.ToString() ?? "null"}. StdErr: {res.Error}"); } var analysis = await ParseXmlAsync(output, pageProgress, ct).ConfigureAwait(false); System.IO.File.Delete(output); return(analysis); }