Пример #1
0
	// don't really want this to be public, but allows us to load the last opened
	// file on startup
	public void DoReadGedcom(string gedcomFile, bool merge)
	{
	
		StatusBar.Push(0, "Reading " + gedcomFile);
		
		BackgroundGedcomRecordReader reader = new BackgroundGedcomRecordReader();

		reader.Parser.AllowHyphenOrUnderscoreInTag = AppSettings.Instance.AllowHypenAndUnderscore;
		reader.Parser.AllowInformationSeparatorOne = AppSettings.Instance.AllowInformationSeparatorOneLoad;
		reader.Parser.AllowLineTabs = AppSettings.Instance.AllowLineTabsLoad;
		reader.Parser.AllowTabs = AppSettings.Instance.AllowTabsLoad;
		reader.Parser.ApplyConcContOnNewLineHack = AppSettings.Instance.ApplyConcContOnNewLineHack;
		reader.Parser.IgnoreInvalidDelim = AppSettings.Instance.IgnoreInvalidDelimeter;
		reader.Parser.IgnoreMissingTerms = AppSettings.Instance.IgnoreMissingLineTerminator;
		
		if (!merge)
		{
			reader.Completed += new RunWorkerCompletedEventHandler(DoReadGedcom_Completed);
		}
		else
		{
			reader.Completed += new RunWorkerCompletedEventHandler(DoMergeGedcom_Completed);
		}
		reader.ProgressChanged += new ProgressChangedEventHandler(DoReadGedcom_ProgressChanged);

		reader.ReadGedcom(gedcomFile);
	}
Пример #2
0
		private void DoReadGedcom(string gedcomFile, bool merge)
		{
			toolStripStatusLabel1.Text = "Reading " + gedcomFile;

			BackgroundGedcomRecordReader reader = new BackgroundGedcomRecordReader();

			if (!merge)
			{
				reader.Completed += new RunWorkerCompletedEventHandler(DoReadGedcom_Completed);
			}
			else
			{
				reader.Completed += new RunWorkerCompletedEventHandler(DoMergeGedcom_Completed);
			}

			reader.ProgressChanged += new ProgressChangedEventHandler(DoReadGedcom_ProgressChanged);

			reader.ReadGedcom(gedcomFile);
		}