示例#1
0
        /// <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);
        }
示例#2
0
        /// <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();
            }
        }
示例#3
0
        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));
        }
示例#4
0
		/// ------------------------------------------------------------------------------------
		/// <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);
		}
示例#5
0
        /// ------------------------------------------------------------------------------------
        /// <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);
        }
示例#6
0
 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);
     }
 }
示例#7
0
		private void LoadCases(IWfiWordSet wordSet)
		{
			m_hvos = wordSet.CasesRC.ToHvoArray();
		}
示例#8
0
 private void LoadCases(IWfiWordSet wordSet)
 {
     m_hvos = wordSet.CasesRC.ToHvoArray();
 }
示例#9
0
		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));
		}
示例#10
0
		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);
		}