private void switchSidesToolStripMenuItem_Click(object sender, EventArgs e) { ComparableXmlFile temp = leftFile; leftFile = rightFile; rightFile = temp; RenderFiles(); }
private void OpenFile(OpenFileDialog dialog, TextBox textBoxPath, ref ComparableXmlFile file) { DialogResult result = dialog.ShowDialog(); if (result != DialogResult.OK) { return; } textBoxPath.Text = dialog.FileName; try { file = new ComparableXmlFile(textBoxPath.Text); } catch { MessageBox.Show(string.Format("Could not load file {0}", textBoxPath.Text)); } RenderFiles(); }
static void Main(string[] args) { ComparableXmlFile originalFile = new ComparableXmlFile(args[0]); ComparableXmlFile changedFile = new ComparableXmlFile(args[1]); Block diff = originalFile.DiffWith(changedFile); Assembly assembly = typeof(StructuredFileDiff.Cmd.Program).Assembly; string templateString = ReadResource(assembly, "XmlDiffTest.Resources.template.html"); string rowString = ReadResource(assembly, "XmlDiffTest.Resources.row.html"); Template htmlTemplate = Template.Parse(templateString); Template rowTemplate = Template.Parse(rowString); string tableContent = CreateTable(rowTemplate, diff, String.Empty, String.Empty); string output = htmlTemplate.Render(new { tableContent = tableContent, }); Console.WriteLine(output); }