AjaxControlToolkit.Localization.GetLocalizationScriptReferences C# (CSharp) Method

GetLocalizationScriptReferences() public method

public GetLocalizationScriptReferences ( ) : IEnumerable
return IEnumerable
        public IEnumerable<ScriptReference> GetLocalizationScriptReferences()
        {
            var localeKey = GetLocaleKey();

            var localeScriptInfos = GetAllLocaleScriptInfo()
                .Where(i => i.LocaleKey == "" || i.LocaleKey == localeKey);

            IEnumerable<ScriptReference> scriptReferences = null;

            if(_externalLocales.ContainsKey(localeKey)) {
                var externalScriptReference = _externalLocales[localeKey](localeKey);

                scriptReferences = localeScriptInfos
                    .Where(i => i.LocaleKey == "")
                    .Select(i => CreateScriptReference(i.LocaleKey, i.ScriptAsssembly))
                    .Concat(new List<ScriptReference>() { externalScriptReference });
            } else
                scriptReferences = localeScriptInfos.Select(i => CreateScriptReference(i.LocaleKey, i.ScriptAsssembly));

            foreach(var reference in scriptReferences)
                yield return reference;
        }