// Token: 0x0600286D RID: 10349 RVA: 0x000959EC File Offset: 0x00093BEC
        public static ResourceBase[] GetUserDataEmbeddedLinks(Slab bootSlab, string owaVersion)
        {
            IEnumerable <ResourceBase> nonThemedUserDataEmbededLinks = UserResourcesFinder.GetNonThemedUserDataEmbededLinks(bootSlab, owaVersion);

            ThemeStyleResource[] userDataEmbededStylesLinks = UserResourcesFinder.GetUserDataEmbededStylesLinks(bootSlab, owaVersion);
            return(nonThemedUserDataEmbededLinks.Union(userDataEmbededStylesLinks).ToArray <ResourceBase>());
        }
Esempio n. 2
0
 protected Slab GetBootSlab()
 {
     if (this.bootSlab == null)
     {
         this.bootSlab = UserResourcesFinder.CreateUserBootSlab(this.ManifestType, this.UserAgent.Layout, this.VersionString);
     }
     return(this.bootSlab);
 }
        // Token: 0x0600286B RID: 10347 RVA: 0x000958E8 File Offset: 0x00093AE8
        internal static Slab CreateUserBootSlab(SlabManifestType manifestType, LayoutType layout, string owaVersion)
        {
            BootSlabDefinition bootSlabDefinition = SlabManifestCollectionFactory.GetInstance(owaVersion).GetSlabManifest(manifestType, layout).GetBootSlabDefinition();
            UserContext        userContext        = (manifestType == SlabManifestType.Anonymous || manifestType == SlabManifestType.GenericMail) ? null : UserContextManager.GetUserContext(HttpContext.Current);

            string[] enabledFeatures = UserResourcesFinder.GetEnabledFeatures(manifestType, userContext);
            return(bootSlabDefinition.GetSlab(enabledFeatures, layout));
        }
Esempio n. 4
0
        // Token: 0x0600287B RID: 10363 RVA: 0x00095BDC File Offset: 0x00093DDC
        public void ProcessRequest(HttpContext context)
        {
            this.Context = context;
            UserContext userContext       = UserContextManager.GetUserContext(context);
            string      currentOwaVersion = userContext.CurrentOwaVersion;

            this.pageContext             = this.GetPageContext(context, currentOwaVersion);
            this.SessionDataEnabled      = false;
            context.Response.ContentType = "application/x-javascript";
            this.Response.Cache.SetCacheability(HttpCacheability.NoCache);
            this.Response.CacheControl = "No-Cache";
            this.Response.Cache.SetNoServerCaching();
            ResourceBase[] userDataEmbeddedLinks = UserResourcesFinder.GetUserDataEmbeddedLinks(this.pageContext.ManifestType, this.pageContext.UserAgent.Layout, currentOwaVersion);
            UserSpecificResourceInjectorBase.WriteScriptBlock(new Action <string>(this.Context.Response.Write), this.pageContext, userContext, userDataEmbeddedLinks, currentOwaVersion);
        }
        // Token: 0x06002871 RID: 10353 RVA: 0x00095ADC File Offset: 0x00093CDC
        public static string GetEnabledFlightedFeaturesJsonArray(SlabManifestType type, IUserContext userContext, FlightedFeatureScope scope)
        {
            HashSet <string> source = new HashSet <string>();

            if (userContext != null)
            {
                source = UserResourcesFinder.GetEnabledFlightedFeatures(type, userContext, scope);
            }
            DataContractJsonSerializer dataContractJsonSerializer = new DataContractJsonSerializer(typeof(string[]));
            string @string;

            using (MemoryStream memoryStream = new MemoryStream())
            {
                dataContractJsonSerializer.WriteObject(memoryStream, source.ToArray <string>());
                memoryStream.Close();
                @string = Encoding.UTF8.GetString(memoryStream.ToArray());
            }
            return(@string);
        }
Esempio n. 6
0
		// Token: 0x060026B1 RID: 9905 RVA: 0x0008C268 File Offset: 0x0008A468
		protected override string GetFeaturesSupportedJsonArray(FlightedFeatureScope scope)
		{
			UserContext userContext = UserContextManager.GetUserContext(HttpContext.Current);
			return UserResourcesFinder.GetEnabledFlightedFeaturesJsonArray(this.ManifestType, userContext, scope);
		}
Esempio n. 7
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;");
        }
        // Token: 0x06002870 RID: 10352 RVA: 0x00095ABC File Offset: 0x00093CBC
        public static ResourceBase[] GetUserDataEmbeddedLinks(SlabManifestType manifestType, LayoutType layout, string owaVersion)
        {
            Slab bootSlab = UserResourcesFinder.CreateUserBootSlab(manifestType, layout, owaVersion);

            return(UserResourcesFinder.GetUserDataEmbeddedLinks(bootSlab, owaVersion));
        }