/// ------------------------------------------------------------------------------------
        /// <summary>
        /// This gets fired when the user clicks on the "Refresh Chart" on the drop-down
        /// showing suprasegmentals to ignore.
        /// </summary>
        /// ------------------------------------------------------------------------------------
        private void HandleRefreshChartClick(object sender, EventArgs e)
        {
            var oldList = Project.IgnoredSymbolsInCVCharts.OrderBy(s => s, StringComparer.Ordinal).ToList();
            var newList = _ignoredSymbolsDropDown.GetIgnoredSymbols().OrderBy(s => s, StringComparer.Ordinal).ToList();

            var listsAreDifferent = (oldList.Count != newList.Count);

            if (!listsAreDifferent)
            {
                for (int i = 0; i < oldList.Count; i++)
                {
                    listsAreDifferent = (oldList[i] != newList[i]);
                    if (listsAreDifferent)
                    {
                        break;
                    }
                }
            }

            _tmAdapter.HideBarItemsPopup("tbbIgnoredSymbols");
            Application.DoEvents();

            // Only refresh when the list changed.
            if (listsAreDifferent)
            {
                Project.IgnoredSymbolsInCVCharts = newList;
                Project.Save();
                ProjectInventoryBuilder.Process(Project);
                App.MsgMediator.SendMessage("RefreshCVChartAfterIgnoredSymbolsChanged", null);
            }
        }
示例#2
0
        /// ------------------------------------------------------------------------------------
        private void BuildFilteredWordCache(IEnumerable <WordCacheEntry> tmpWordCache)
        {
            var wordCache = tmpWordCache.ToArray();

            WordsNotInCurrentFilter = new WordCache();
            WordCache  = new WordCache();
            PhoneCache = GetPhonesFromWordCache(wordCache);

            foreach (var wentry in wordCache)
            {
                if (_project.FilterHelper.EntryMatchesCurrentFilter(wentry))
                {
                    WordCache.Add(wentry);
                }
                else
                {
                    WordsNotInCurrentFilter.Add(wentry);
                }
            }

            PhoneCache = GetPhonesFromWordCache(WordCache);
            _project.FilterHelper.PostCacheBuildingFinalize();
            ProjectInventoryBuilder.Process(_project);
        }