示例#1
0
        static void UpdateTermsCache(LanguageSourceData source, string filter, ref GUIContent[] terms_Contexts, ref int framesBeforeUpdating, ref string prevFilter)
        {
            framesBeforeUpdating--;
            if (terms_Contexts != null && framesBeforeUpdating > 0 && filter == prevFilter)
            {
                return;
            }
            framesBeforeUpdating = 60;
            prevFilter           = filter;

            var Terms = (source == null ? LocalizationManager.GetTermsList() : source.GetTermsList());

            if (string.IsNullOrEmpty(filter) == false)
            {
                Terms = Filter(Terms, filter);
            }

            Terms.Sort(System.StringComparer.OrdinalIgnoreCase);
            Terms.Add("");
            Terms.Add("<inferred from text>");
            Terms.Add("<none>");

            terms_Contexts = DisplayOptions(Terms);
        }