示例#1
0
 public CGedcomFileHandler()
 {
     //Create structured output Element
     output               = new CConstants.fileHandlerReturnStruct();
     output.xmlDoc        = new XmlDocument();
     output.flowDoc       = new FlowDocument();
     output.personCounter = 0;
 }
示例#2
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();
        }
示例#3
0
        private string buildUidString(string[] informationConstituents, string uidString, XmlElement theXmlElement, CConstants.fileHandlerReturnStruct outputStructure)
        {
            //Information to be included in UID
            if (informationConstituents[1] != null &&
                (informationConstituents[0] == CConstants.xmlElementName ||
                 informationConstituents[0] == CConstants.xmlElementSex ||
                 informationConstituents[0] == CConstants.xmlElement_UID))
            {
                uidString = createUidString(uidString, theXmlElement.Name, informationConstituents[1].ToString());
            }

            return(uidString);
        }