Exemplo n.º 1
0
        private void switchSidesToolStripMenuItem_Click(object sender, EventArgs e)
        {
            ComparableXmlFile temp = leftFile;

            leftFile  = rightFile;
            rightFile = temp;

            RenderFiles();
        }
Exemplo n.º 2
0
        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();
        }
Exemplo n.º 3
0
        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);
        }