private void button2_Click(object sender, EventArgs e) { if (serverConfigPathBox.Text == "" || inputXmlBox.Text == "") { return; } HaJSCompiler jsc = new HaJSCompiler(serverConfigPathBox.Text); string folder = Path.GetDirectoryName(inputXmlBox.Text); foreach (FileInfo fi in new DirectoryInfo(folder).GetFiles()) { if (fi.Extension.ToLower() == ".xml") { #if !DEBUG try { #endif jsc.Compile(fi.FullName, Path.Combine(folder, Path.GetFileNameWithoutExtension(fi.FullName) + ".js")); #if !DEBUG } catch (Exception ex) { MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); break; } #endif } } MessageBox.Show("Finished compiling " + folder); }
private void button1_Click(object sender, EventArgs e) { if (serverConfigPathBox.Text == "" || inputXmlBox.Text == "") { return; } HaJSCompiler jsc = new HaJSCompiler(serverConfigPathBox.Text); string outPath = Path.Combine(Path.GetDirectoryName(inputXmlBox.Text), Path.GetFileNameWithoutExtension(inputXmlBox.Text) + ".js"); #if !DEBUG try { #endif jsc.Compile(inputXmlBox.Text, outPath); MessageBox.Show("Finished compiling to " + outPath); #if !DEBUG } catch (Exception ex) { MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } #endif }