public MarkerPresenter(FdoCache cache, string mapfile, string datafile, string fwFile, int numColumns) { m_cache = cache; m_mapFile = mapfile; m_dataFile = datafile; m_fwFile = fwFile; m_numColumns = numColumns; m_SortOrder = new ArrayList(); for (int i=0; i<numColumns; i++) { m_SortOrder.Add(true); } m_SortOrder[1] = false; // handle first click in column one bool goodMap = InitFromMapFile(m_mapFile); m_DataInfo = new Sfm2Xml.SfmFileReader(m_dataFile); // read in the Lex Import Fields string sRootDir = SIL.FieldWorks.Common.Utils.DirectoryFinder.FWCodeDirectory; if (!sRootDir.EndsWith("\\")) sRootDir += "\\"; string sImportFileds = sRootDir + "Language Explorer\\Import\\ImportFields.xml"; m_LexFields = new LexImportFields(); m_LexFields.ReadLexImportFields(sImportFileds); // get a list of the languages that are defined/editied in the GUI m_htUILangInfo = LexImportWizard.Wizard().GetUILanguages(); // this will now fill the m_htMarkerData hashtable with contentmapping objects MergeData(); }
public MarkerPresenter(/*FdoCache cache, */ string rootDir, Hashtable uiLangInfo, string topAnalysisWS, string mapfile, string datafile, string fwFile, int numColumns) { m_rootDir = rootDir; m_topAnalysisWS = topAnalysisWS; m_mapFile = mapfile; m_dataFile = datafile; m_fwFile = fwFile; m_numColumns = numColumns; m_SortOrder = new ArrayList(); for (int i = 0; i < numColumns; i++) { m_SortOrder.Add(true); } m_SortOrder[1] = false; // handle first click in column one bool goodMap = InitFromMapFile(m_mapFile); m_DataInfo = new Sfm2Xml.SfmFileReader(m_dataFile); bool changed; UpdateLexFieldsWithCustomFields(LexImportWizard.Wizard().ReadCustomFieldsFromDB(out changed) as Sfm2Xml.LexImportFields); // get a list of the languages that are defined/editied in the GUI m_htUILangInfo = uiLangInfo; //LexImportWizard.Wizard().GetUILanguages(); // this will now fill the m_htMarkerData hashtable with contentmapping objects MergeData(false); }
public bool UpdateSfmDataChanged() { m_DataInfo = new Sfm2Xml.SfmFileReader(m_dataFile); return MergeData(true); }
/// Step 4 is where the markers are managed: displayed and processed. #region Step 4 event handlers and routines void ReadMarkersFromDataFile() { #if false Sfm2Xml.SfmFileReader testReader = new Sfm2Xml.SfmFileReader(m_DatabaseFileName.Text); lblTotalMarkers.Text = String.Format("Number of Markers: {0}", testReader.Count); listViewContentMapping.Items.Clear(); listViewContentMapping.BeginUpdate(); foreach( string sfmKEY in testReader.SfmInfo) { // LT-1926 Ignore all markers that start with underscore (shoebox markers) if (sfmKEY.StartsWith("_")) continue; ListViewItem lvItem = new ListViewItem(new string[] {sfmKEY, Convert.ToString(testReader.GetSFMCount(sfmKEY))}); listViewContentMapping.Items.Add(lvItem); // int sfmCOUNTTEST = testReader.GetSFMCount(sfmKEY); } // sort initially by the 'order of appearance' listViewContentMapping.ListViewItemSorter = new MarkerPresenter.ListViewItemComparer(1, this.m_MappingMgr.GetAndChangeColumnSortOrder(1)); // now hide the column listViewContentMapping.Columns[1].Width = 0; listViewContentMapping.EndUpdate(); #endif }