// Token: 0x0600264B RID: 9803 RVA: 0x0008A228 File Offset: 0x00088428
        protected virtual IEnumerable <string> GetScripts(bool generateBootResourcesAppcache)
        {
            bool isMowaClient = this.IsMowaClient;
            SlabManifestCollection slabManifestCollection = this.SlabManifestCollection;
            SlabManifestType       slabManifestType       = isMowaClient ? SlabManifestType.Pal : SlabManifestType.Standard;

            string[]             enabledFeatures = this.GetEnabledFeatures();
            IEnumerable <string> enumerable      = from source in slabManifestCollection.GetCodeScriptResources(SlabManifestType.PreBoot, this.UserAgent.Layout, enabledFeatures, false).Union(slabManifestCollection.GetCodeScriptResources(slabManifestType, this.UserAgent.Layout, enabledFeatures, generateBootResourcesAppcache))
                                                   select string.Format("../prem/{0}/scripts/{1}", this.VersionString, source);

            IEnumerable <string> source3 = from source in slabManifestCollection.GetLocalizedStringsScriptResources(SlabManifestType.PreBoot, this.UserAgent.Layout, enabledFeatures, false).Union(slabManifestCollection.GetLocalizedStringsScriptResources(slabManifestType, this.UserAgent.Layout, enabledFeatures, generateBootResourcesAppcache))
                                           select source;

            if (source3.Any <string>())
            {
                LocalizedStringsScriptResource localizedStringsScriptResource = new LocalizedStringsScriptResource(source3.First <string>(), ResourceTarget.Any, this.VersionString);
                string cultureName          = localizedStringsScriptResource.GetLocalizedCultureName();
                IEnumerable <string> second = from source in source3
                                              select string.Format("../prem/{0}/scripts/{1}/{2}", this.VersionString, cultureName.ToLowerInvariant(), source);

                enumerable = enumerable.Union(second);
            }
            IEnumerable <string> source2 = from source in slabManifestCollection.GetLocalizedExtStringsScriptResources(SlabManifestType.PreBoot, this.UserAgent.Layout, enabledFeatures, false).Union(slabManifestCollection.GetLocalizedExtStringsScriptResources(slabManifestType, this.UserAgent.Layout, enabledFeatures, generateBootResourcesAppcache))
                                           select source;

            if (source2.Any <string>())
            {
                LocalizedExtensibilityStringsScriptResource localizedExtensibilityStringsScriptResource = new LocalizedExtensibilityStringsScriptResource(source2.First <string>(), ResourceTarget.Any, this.VersionString);
                string cultureName           = localizedExtensibilityStringsScriptResource.GetLocalizedCultureName();
                IEnumerable <string> second2 = from source in source2
                                               select string.Format("../prem/{0}/scripts/ext/{1}/{2}", this.VersionString, cultureName.ToLowerInvariant(), source);

                enumerable = enumerable.Union(second2);
            }
            return(enumerable);
        }
 private string GetLocalizedCultureName(string resourceName)
 {
     return(LocalizedStringsScriptResource.GetLocalizedCultureName(LocalizedExtensibilityStringsScriptResource.threadCultureToLocalizedCultureMap, Thread.CurrentThread.CurrentCulture, (string lang) => this.ResourceExists(resourceName, lang)));
 }
Exemple #3
0
 // Token: 0x060026F8 RID: 9976 RVA: 0x0008D498 File Offset: 0x0008B698
 private string GetScriptDirectory(IPageContext pageContext, CultureInfo cultureInfo, string resourceName, bool isBootScriptsDirectory)
 {
     return(this.GetScriptDirectoryFromCultureName(pageContext, LocalizedStringsScriptResource.GetLocalizedCultureName(LocalizedStringsScriptResource.threadCultureToLocalizedCultureMap, cultureInfo, (string lang) => this.ResourceExists(resourceName, lang)), isBootScriptsDirectory));
 }
Exemple #4
0
 // Token: 0x060026F6 RID: 9974 RVA: 0x0008D420 File Offset: 0x0008B620
 internal static string GetLocalizedCultureName(ConcurrentDictionary <string, string> cultureMap, CultureInfo culture, Func <string, bool> existsFilter)
 {
     return(cultureMap.GetOrAdd(culture.Name, (string x) => LocalizedStringsScriptResource.GetLocalizedCultureName(culture, existsFilter)));
 }
Exemple #5
0
        // Token: 0x0600287C RID: 10364 RVA: 0x00095C9C File Offset: 0x00093E9C
        public static void WriteScriptBlock(Action <string> responseWriter, IPageContext pageContext, IUserContext userContext, ResourceBase[] userDataEmbeddedLinks, string owaVersion)
        {
            string text = null;
            string name = Thread.CurrentThread.CurrentCulture.Name;

            responseWriter("var blockToAdd;");
            foreach (ResourceBase resourceBase in userDataEmbeddedLinks)
            {
                ScriptResource scriptResource = resourceBase as ScriptResource;
                LocalizedStringsScriptResource localizedStringsScriptResource = scriptResource as LocalizedStringsScriptResource;
                string text2 = resourceBase.GetResourcePath(pageContext, true);
                if (scriptResource is LocalizedStringsScriptResource)
                {
                    text = localizedStringsScriptResource.GetLocalizedCultureName();
                }
                else
                {
                    string obj;
                    if (scriptResource != null)
                    {
                        obj = "userScriptResources";
                    }
                    else
                    {
                        obj = "styleResources";
                    }
                    string     text3      = "LT_ANY";
                    LayoutType layoutType = LayoutType.Mouse;
                    if (ResourceTarget.MouseOnly.Equals(resourceBase.TargetFilter))
                    {
                        layoutType = LayoutType.Mouse;
                        text3      = "LT_MOUSE";
                    }
                    else if (ResourceTarget.WideOnly.Equals(resourceBase.TargetFilter) || ResourceTarget.WideHighResolution.Equals(resourceBase.TargetFilter))
                    {
                        layoutType = LayoutType.TouchWide;
                        text3      = "LT_TWIDE";
                    }
                    else if (ResourceTarget.NarrowOnly.Equals(resourceBase.TargetFilter) || ResourceTarget.NarrowHighResolution.Equals(resourceBase.TargetFilter))
                    {
                        layoutType = LayoutType.TouchNarrow;
                        text3      = "LT_TNARROW";
                    }
                    if (!(text3 != "LT_ANY") || layoutType == pageContext.UserAgent.Layout)
                    {
                        responseWriter(obj);
                        responseWriter("[");
                        responseWriter(obj);
                        responseWriter(".length] = {");
                        responseWriter(" \"fileName\": ");
                        string text4 = "prem/" + owaVersion;
                        if (pageContext.IsAppCacheEnabledClient && text2.StartsWith(text4))
                        {
                            text2 = text2.Substring(text4.Length);
                            string obj2 = string.Format("\"prem/\" + {0} + ", "sver");
                            responseWriter(obj2);
                        }
                        responseWriter("\"" + text2);
                        responseWriter("\", \"layout\": ");
                        responseWriter(text3);
                        if (ResourceTarget.WideHighResolution.Equals(resourceBase.TargetFilter) || ResourceTarget.NarrowHighResolution.Equals(resourceBase.TargetFilter))
                        {
                            responseWriter(", \"highResolution\": true");
                        }
                        responseWriter("};\r\n");
                    }
                }
            }
            string text5;
            string text6;

            if (userContext != null && userContext.FeaturesManager.ClientServerSettings.OwaVersioning.Enabled)
            {
                text5 = string.Format("'{0}'", ExchangeVersionType.V2_6.ToString());
                text6 = string.Format("'{0}'", ExchangeVersion.Latest.Version);
            }
            else
            {
                text5 = "null";
                text6 = "null";
            }
            string text7 = "[]";

            if (userContext != null)
            {
                text7 = UserResourcesFinder.GetEnabledFlightedFeaturesJsonArray(pageContext.ManifestType, userContext, FlightedFeatureScope.ClientServer);
            }
            responseWriter(string.Format("setupUserSpecificResources('{0}', '{1}', '{2}', '{3}', {4}, {5}, {6}, '{7}', '{8}', {9}, {10});\r\n", new object[]
            {
                owaVersion,
                pageContext.Theme,
                name,
                text,
                DefaultPageBase.IsRtl ? "true" : "false",
                text5,
                text6,
                DefaultPageBase.ThemeStyleCultureDirectory,
                UserResourcesFinder.GetResourcesHash(userDataEmbeddedLinks, pageContext, true, owaVersion),
                text7,
                "3"
            }));
            responseWriter("userSpecificsLoaded = true;");
        }