コード例 #1
0
ファイル: WordFormFilters.cs プロジェクト: sillsdev/WorldPad
        /// <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(FdoCache cache)
        {
            int        hvo     = Int32.Parse(m_id);
            WfiWordSet wordSet = new WfiWordSet(cache, hvo);

            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
ファイル: WordFormFilters.cs プロジェクト: sillsdev/WorldPad
        /// ------------------------------------------------------------------------------------
        /// <summary>
        /// Initializes a new instance of the <see cref="T:WordSetFilter"/> class.
        /// </summary>
        /// <param name="wordSet">The word set.</param>
        /// ------------------------------------------------------------------------------------
        public WordSetFilter(WfiWordSet wordSet)
        {
//			m_wordSet = wordSet;
//			m_cases = m_wordSet.CasesRC;
            this.m_id = wordSet.Hvo.ToString();
            m_name    = wordSet.Name.AnalysisDefaultWritingSystem;
            LoadCases(wordSet);
        }
コード例 #4
0
ファイル: WordFormFilters.cs プロジェクト: sillsdev/WorldPad
 private void LoadCases(WfiWordSet wordSet)
 {
     m_hvos = wordSet.CasesRC.HvoArray;
 }