public void loadGedcomDataTest()
 {
     SetupTestVariables();
     Gedcom2XMLParser target = new Gedcom2XMLParser(gedcomDocumentName, xmlDocumentName);
     result = target.loadGedcomData();
     Assert.IsTrue(result);
 }
示例#2
0
 /// <summary>
 /// Event handler for the Parse It button.
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void btnParseIt_Click(object sender, EventArgs e)
 {
     m_xmlFile    = tbSelectXML.Text;
     m_gedcomFile = tbSelectGedcom.Text;
     if (m_xmlFile != string.Empty && m_gedcomFile != string.Empty)
     {
         try
         {
             bool result = true;
             m_gdc2xml = new Gedcom2XMLParser(m_gedcomFile, m_xmlFile);
             result    = m_gdc2xml.loadGedcomData();
             result    = m_gdc2xml.processGedcomDataToXML();
             result    = m_gdc2xml.saveDoc();
             if (result == false)
             {
                 MessageBox.Show("Error while processsing the files! " +
                                 "Some or all of the content is probably not processed.");
             }
             if (result == true)
             {
                 tbStatus.Text += m_gdc2xml.getStatistics() + "\n\r \n\r";
             }
         }
         catch (Exception ex)
         {
             MessageBox.Show(ex.Message);
         }
     }
     else
     {
         if (m_gedcomFile == string.Empty)
         {
             MessageBox.Show("Please enter a valid GEDCOM format file to be parsed.");
         }
         if (m_xmlFile == string.Empty)
         {
             MessageBox.Show("Please enter a valid XML file name to output to." +
                             " Warning! An existing file of the same name will be overwritten!");
         }
     }
 }
示例#3
0
 /// <summary>
 /// constructor
 /// </summary>
 public frmG2X_GUI()
 {
     InitializeComponent();
     m_gdc2xml = null;
 }
示例#4
0
 /// <summary>
 /// Event handler for the Parse It button.
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void btnParseIt_Click(object sender, EventArgs e)
 {
     m_xmlFile = tbSelectXML.Text;
     m_gedcomFile = tbSelectGedcom.Text;
     if (m_xmlFile != string.Empty && m_gedcomFile != string.Empty)
     {
         try
         {
             bool result = true;
             m_gdc2xml = new Gedcom2XMLParser(m_gedcomFile, m_xmlFile);
             result = m_gdc2xml.loadGedcomData();
             result = m_gdc2xml.processGedcomDataToXML();
             result = m_gdc2xml.saveDoc();
             if (result == false)
                 MessageBox.Show("Error while processsing the files! " +
                                 "Some or all of the content is probably not processed.");
             if (result == true)
                 tbStatus.Text += m_gdc2xml.getStatistics() + "\n\r \n\r";
         }
         catch (Exception ex)
         {
             MessageBox.Show(ex.Message);
         }
     }
     else
     {
         if (m_gedcomFile == string.Empty)
             MessageBox.Show("Please enter a valid GEDCOM format file to be parsed.");
         if (m_xmlFile == string.Empty)
             MessageBox.Show("Please enter a valid XML file name to output to." +
                             " Warning! An existing file of the same name will be overwritten!");
     }
 }
示例#5
0
 /// <summary>
 /// constructor
 /// </summary>
 public frmG2X_GUI()
 {
     InitializeComponent();
     m_gdc2xml = null;
 }
 public void saveDocTest()
 {
     SetupTestVariables();
     Gedcom2XMLParser target = new Gedcom2XMLParser(gedcomDocumentName, xmlDocumentName);
     target.loadGedcomData();
     target.processGedcomDataToXML();
     result = target.saveDoc();
     Assert.IsTrue(result);
 }
 public void Gedcom2XMLParserConstructorTest()
 {
     SetupTestVariables();
     Gedcom2XMLParser target = new Gedcom2XMLParser(gedcomDocumentName, xmlDocumentName);
     Assert.IsNotNull(target);
 }