Ejemplo n.º 1
0
        private void openFiles_Click(object sender, RoutedEventArgs e)
        {
            diffCheckPerformed = false;
            filesLoaded        = false;
            OpenFileDialog theFileDialog = new OpenFileDialog();

            theFileDialog.Title = "Open File 1 (left side)";

            theFileDialog.Filter = "GEDCOM File (*.ged)|*.ged";
            if (theFileDialog.ShowDialog() == true)
            {
                // Parse GEDCOM file to XML Document
                CGedcomFileHandler fileHandler1 = new CGedcomFileHandler();

                parsedFileData1 = fileHandler1.parseGedcomToXml(theFileDialog.FileName);
                theDataManipulator.theXmlDocument1 = parsedFileData1.xmlDoc;
                textBoxGDI1.Document = parsedFileData1.flowDoc;
                string[] fileNameArray;
                fileNameArray = theFileDialog.FileName.Split(new char[] { '\\' });
                int arraySize = fileNameArray.Length;
                headerGDI1.Text = fileNameArray[arraySize - 1].ToString() +
                                  ": " +
                                  parsedFileData1.personCounter.ToString() +
                                  " Persons";
            }

            theFileDialog.FileName = "";
            theFileDialog.Title    = "Open File 2 (right side)";

            if (theFileDialog.ShowDialog() == true)
            {
                // Parse GEDCOM file to XML Document
                CGedcomFileHandler fileHandler2 = new CGedcomFileHandler();
                parsedFileData2 = fileHandler2.parseGedcomToXml(theFileDialog.FileName);
                theDataManipulator.theXmlDocument2 = parsedFileData2.xmlDoc;
                textBoxGDI2.Document = parsedFileData2.flowDoc;
                string[] fileNameArray;
                fileNameArray = theFileDialog.FileName.Split(new char[] { '\\' });
                int arraySize = fileNameArray.Length;
                headerGDI2.Text = fileNameArray[arraySize - 1].ToString() +
                                  ": " +
                                  parsedFileData2.personCounter.ToString() +
                                  " Persons";
            }

            if (theDataManipulator.theXDocument1 != null && theDataManipulator.theXDocument2 != null)
            {
                this.filesLoaded = true;
            }

            this.updateMetadata();
            this.Activate();
        }
Ejemplo n.º 2
0
        public Report(CConstants.dataManipulatorStructure reportDataInput)
        {
            theReportData      = new CConstants.dataManipulatorStructure();
            theFileHandler     = new CGedcomFileHandler();
            theDataManipulator = new CDataManipulator();

            theReportData = reportDataInput;
            InitializeComponent();
            this.theReportTextBox.Document = theReportData.flowDoc;
            int numberOfPersons = theReportData.flowDoc.Blocks.Where(test => test.Name.Contains("INDI_")).Count();

            this.Title = "Combined Data: " + numberOfPersons.ToString() + " Persons";
        }
Ejemplo n.º 3
0
        private void saveFiles_Click(object sender, RoutedEventArgs e)
        {
            CGedcomFileHandler theFileHandler = new CGedcomFileHandler();

            if (parsedFileData1.flowDoc != null &&
                parsedFileData1.xmlDoc != null)
            {
                theFileHandler.saveDataToFile(parsedFileData1.flowDoc, parsedFileData1.xmlDoc);
            }
            if (parsedFileData2.flowDoc != null &&
                parsedFileData2.xmlDoc != null)
            {
                theFileHandler.saveDataToFile(parsedFileData2.flowDoc, parsedFileData2.xmlDoc);
            }
        }