/// <summary> /// Sync the word references to the state of the word list in the database. /// This is what we need to do when restoring our Filter from xml to make sure /// the ids are valid. /// </summary> /// <param name="cache"></param> internal void ReloadWordSet(LcmCache cache) { int hvo = Int32.Parse(m_id); IWfiWordSet wordSet = cache.ServiceLocator.GetObject(hvo) as IWfiWordSet; LoadCases(wordSet); }
/// <summary> /// Parse the given lists of files and create a wordset from them. /// </summary> /// <param name="paths"></param> /// <remarks>This is marked internal so that unit tests can call it</remarks> internal void CreateWordsetFromFiles(string[] paths) { CheckDisposed(); using (ProgressDialogWorkingOn dlg = new ProgressDialogWorkingOn()) { string sWordSetName = GetWordSetName(paths); IWfiWordSet wordSet = WfiWordSet.Create(m_cache, sWordSetName, GetWordSetDescription(paths)); dlg.Owner = FindForm(); dlg.Icon = dlg.Owner.Icon; dlg.Minimum = 0; dlg.Maximum = paths.Length; dlg.Text = String.Format(ParserUIStrings.ksLoadingFilesForWordSetX, sWordSetName); dlg.Show(); dlg.BringToFront(); using (WordImporter importer = new WordImporter(m_cache)) { foreach (string path in paths) { UpdateProgress(path, dlg); importer.PopulateWordset(path, wordSet); } } dlg.Close(); } }
public void PopulateWordset(string path, IWfiWordSet wordSet) { CheckDisposed(); // Note: The ref collection class ensures duplicates are not added to CasesRC. wordSet.CasesRC.Add(GetWordformsInFile(path)); }
/// ------------------------------------------------------------------------------------ /// <summary> /// Initializes a new instance of the <see cref="T:WordSetFilter"/> class. /// </summary> /// <param name="wordSet">The word set.</param> /// ------------------------------------------------------------------------------------ public WordSetFilter(IWfiWordSet wordSet) { // m_wordSet = wordSet; // m_cases = m_wordSet.CasesRC; this.m_id = wordSet.Hvo.ToString(); m_name = wordSet.Name.AnalysisDefaultWritingSystem.Text; LoadCases(wordSet); }
public void PopulateWordset(string path, IWfiWordSet wordSet) { // Note: The ref collection class ensures duplicates are not added to CasesRC. foreach (var wordform in GetWordformsInFile(path)) { wordSet.CasesRC.Add(wordform); } }
private void LoadCases(IWfiWordSet wordSet) { m_hvos = wordSet.CasesRC.ToHvoArray(); }
public void PopulateWordset(string path, IWfiWordSet wordSet) { // Note: The ref collection class ensures duplicates are not added to CasesRC. foreach (var wordform in GetWordformsInFile(path)) wordSet.CasesRC.Add(wordform); }