Ejemplo n.º 1
0
        private void btnCompareDocuments_Click(object sender, RibbonControlEventArgs e)
        {
            Visio.Application app = SingletonVisioApp.GetCurrentVisioInstance().VisioApp;
            string NameFile1 = OpenFile().FileName;
            string NameFile2 = OpenFile().FileName;
            string OutputDoc = app.Documents.AddEx("").Name;

            PageComparer comparer = new PageComparer(app,app.Documents[NameFile1].Pages[1], app.Documents[NameFile2].Pages[1], app.Documents[OutputDoc].Pages.Add());
            comparer.ComparePages();
        }
Ejemplo n.º 2
0
        public void CompareDocuments()
        {
            //Copy all deleted pages
            GetPagesOnXExceptOnY(_documentA, _documentB, "RGB(255,200,200)");
            //copy all new pages
            GetPagesOnXExceptOnY(_documentB, _documentA, "RGB(200,255,200)");

            foreach (Visio.Page page in GetIntersectionPages())
            {
                Visio.Page resultPage = _resultingDocument.Pages.Add();
                SetupDestinationPage(page, resultPage);
                //Now compare the content of the page....
                PageComparer pageComparer = new PageComparer(_app, _documentA.Pages[page.Name], _documentB.Pages[page.Name], resultPage);
                pageComparer.ComparePages();
            }

            //remove nil pages
            foreach (string guid in _guidsOfNilPages)
            {
                _resultingDocument.Pages[guid].Delete(Convert.ToInt16(false));
            }
        }