public SlabManifest GetSlabManifest(SlabManifestType slabManifestType, LayoutType layout)
        {
            if (this.owaVersion == null)
            {
                return(this.slabManifests[slabManifestType.Name][layout]);
            }
            string name = slabManifestType.Name;
            Dictionary <LayoutType, SlabManifest> dictionary;

            if (!this.slabManifests.TryGetValue(name, out dictionary))
            {
                dictionary = new Dictionary <LayoutType, SlabManifest>();
                string rootPath = FolderConfiguration.Instance.RootPath;
                string manifestDiskRelativeFolderPath = ResourcePathBuilderUtilities.GetManifestDiskRelativeFolderPath(this.owaVersion);
                string text = name + ".xml";
                if (File.Exists(Path.Combine(rootPath, manifestDiskRelativeFolderPath, text)))
                {
                    SlabManifest slabManifest = SlabManifestLoader.Load(rootPath, text, new Action <string, Exception>(SlabManifestCollection.LogManifestExceptionToEventLogs), manifestDiskRelativeFolderPath);
                    slabManifest.Type = slabManifestType;
                    foreach (LayoutType key in SlabManifestCollection.layoutTypes)
                    {
                        dictionary.Add(key, slabManifest);
                    }
                }
                foreach (LayoutType layoutType in SlabManifestCollection.layoutTypes)
                {
                    string text2 = string.Concat(new object[]
                    {
                        name.ToLowerInvariant(),
                        ".",
                        layoutType,
                        ".xml"
                    });
                    if (File.Exists(Path.Combine(rootPath, manifestDiskRelativeFolderPath, text2)))
                    {
                        SlabManifest slabManifest2 = SlabManifestLoader.Load(rootPath, text2, new Action <string, Exception>(SlabManifestCollection.LogManifestExceptionToEventLogs), manifestDiskRelativeFolderPath);
                        slabManifest2.Type = slabManifestType;
                        dictionary.Add(layoutType, slabManifest2);
                    }
                }
                Dictionary <string, Dictionary <LayoutType, SlabManifest> > dictionary2 = new Dictionary <string, Dictionary <LayoutType, SlabManifest> >(this.slabManifests);
                if (!dictionary2.ContainsKey(name))
                {
                    dictionary2[slabManifestType.Name] = dictionary;
                }
                this.slabManifests = dictionary2;
            }
            return(dictionary[layout]);
        }
Example #2
0
        protected string InlineStyles(string filename)
        {
            string text = Path.Combine(FolderConfiguration.Instance.RootPath, ResourcePathBuilderUtilities.GetStyleResourcesRelativeFolderPath(ResourcePathBuilderUtilities.GetResourcesRelativeFolderPath(this.VersionString)), filename);
            Tuple <string, DateTime> tuple;

            lock (DefaultPageBase.inlineStyles)
            {
                DateTime lastWriteTimeUtc = File.GetLastWriteTimeUtc(text);
                if (!DefaultPageBase.inlineStyles.TryGetValue(text, out tuple) || tuple.Item2 < lastWriteTimeUtc)
                {
                    tuple = Tuple.Create <string, DateTime>("<style>" + File.ReadAllText(text) + "</style>", lastWriteTimeUtc);
                    DefaultPageBase.inlineStyles[text] = tuple;
                }
            }
            return(tuple.Item1);
        }
Example #3
0
 protected string GetThemedImagesFolderFormat(bool bootThemedImagesFolder)
 {
     return(this.FormatURIForCDN(ResourcePathBuilderUtilities.GetBootThemeImageResourcesRelativeFolderPath(this.VersionString, ResourcePathBuilderUtilities.GetResourcesRelativeFolderPath(this.VersionString), DefaultPageBase.IsRtl, this.ShouldSkipThemeFolder()), bootThemedImagesFolder));
 }
Example #4
0
 protected string GetImagesFolder(bool bootImagesfolder)
 {
     return(this.FormatURIForCDN(ResourcePathBuilderUtilities.GetBootImageResourcesRelativeFolderPath(ResourcePathBuilderUtilities.GetResourcesRelativeFolderPath(this.VersionString), DefaultPageBase.IsRtl), bootImagesfolder));
 }
Example #5
0
 protected string GetStylesFolder(bool bootStylesFolder)
 {
     return(this.FormatURIForCDN(ResourcePathBuilderUtilities.GetStyleResourcesRelativeFolderPath(ResourcePathBuilderUtilities.GetResourcesRelativeFolderPath(this.VersionString)), bootStylesFolder));
 }
Example #6
0
        protected string InlineImage(string fileName)
        {
            string   text = Path.Combine(Path.Combine(FolderConfiguration.Instance.RootPath, ResourcePathBuilderUtilities.GetBootImageResourcesRelativeFolderPath(ResourcePathBuilderUtilities.GetResourcesRelativeFolderPath(this.VersionString), DefaultPageBase.IsRtl)), fileName);
            DateTime lastWriteTimeUtc;

            try
            {
                lastWriteTimeUtc = File.GetLastWriteTimeUtc(text);
            }
            catch
            {
                return(this.BootImagesFolder + "/" + fileName);
            }
            Tuple <string, DateTime> tuple;

            lock (DefaultPageBase.inlineImages)
            {
                if (!DefaultPageBase.inlineImages.TryGetValue(text, out tuple) || tuple.Item2 < lastWriteTimeUtc)
                {
                    tuple = Tuple.Create <string, DateTime>("data:image/" + Path.GetExtension(fileName).Substring(1) + ";base64," + Convert.ToBase64String(File.ReadAllBytes(text)), lastWriteTimeUtc);
                    DefaultPageBase.inlineImages[text] = tuple;
                }
            }
            return(tuple.Item1);
        }
 public static string GetGlobalizeScriptResourcesRelativeFolderPath(string resourcesRelativeFolderPath)
 {
     return(ResourcePathBuilderUtilities.GetScriptResourcesRelativeFolderPath(resourcesRelativeFolderPath) + "/globalize");
 }
        protected override string GetScriptDirectory(IPageContext pageContext, string resourceName, bool isBootScriptsDirectory)
        {
            string localizedCultureName = this.GetLocalizedCultureName(resourceName);

            return(pageContext.FormatURIForCDN(ResourcePathBuilderUtilities.GetLocalizedScriptResourcesRelativeFolderPath(base.ResourcesRelativeFolderPath, localizedCultureName), isBootScriptsDirectory));
        }
 public static string GetImageResourcesRelativeFolderPath(string resourcesRelativeFolderPath)
 {
     return(ResourcePathBuilderUtilities.GetBootResourcesRelativeFolderPath(resourcesRelativeFolderPath) + "/images/");
 }
 public static string GetStyleResourcesRelativeFolderPathWithSlash(string resourcesRelativeFolderPath)
 {
     return(ResourcePathBuilderUtilities.GetStyleResourcesRelativeFolderPath(resourcesRelativeFolderPath) + "/");
 }
 public static string GetThemeResourcesRelativeFolderPath(string resourcesRelativeFolderPath)
 {
     return(ResourcePathBuilderUtilities.GetBootResourcesRelativeFolderPath(resourcesRelativeFolderPath) + "/themes/{0}/");
 }
 public static string GetStyleResourcesRelativeFolderPath(string resourcesRelativeFolderPath)
 {
     return(ResourcePathBuilderUtilities.GetBootResourcesRelativeFolderPath(resourcesRelativeFolderPath) + "/styles");
 }
 public static string GetLocalizedScriptResourcesRelativeFolderPath(string resourcesRelativeFolderPath, string cultureName)
 {
     return(ResourcePathBuilderUtilities.GetLocalizedScriptResourcesRelativeFolderPath(resourcesRelativeFolderPath) + "/" + cultureName);
 }
 public static string GetLocalizedScriptResourcesRelativeFolderPath(string resourcesRelativeFolderPath)
 {
     return(ResourcePathBuilderUtilities.GetScriptResourcesRelativeFolderPath(resourcesRelativeFolderPath) + "/ext");
 }
Example #15
0
 protected string GetStylesFolderFormat(bool bootStylesFolderFormat)
 {
     return(this.FormatURIForCDN(ResourcePathBuilderUtilities.GetBootStyleResourcesRelativeFolderPath(this.VersionString, ResourcePathBuilderUtilities.GetResourcesRelativeFolderPath(this.VersionString), "#LCL", this.ShouldSkipThemeFolder()), bootStylesFolderFormat));
 }
 // Token: 0x06002700 RID: 9984 RVA: 0x0008D63F File Offset: 0x0008B83F
 protected virtual string GetStyleDirectory(IPageContext pageContext, string theme, bool isBootStylesDirectory)
 {
     return(pageContext.FormatURIForCDN(ResourcePathBuilderUtilities.GetStyleResourcesRelativeFolderPath(base.ResourcesRelativeFolderPath), isBootStylesDirectory));
 }
 public static string GetManifestDiskRelativeFolderPath(string owaVersion)
 {
     return(Path.Combine(ResourcePathBuilderUtilities.GetResourcesRelativeFolderPath(owaVersion), "manifests"));
 }
        private bool ResourceExists(string resourceName, string languageName)
        {
            string path = Path.Combine(FolderConfiguration.Instance.RootPath, ResourcePathBuilderUtilities.GetLocalizedScriptResourcesRelativeFolderPath(base.ResourcesRelativeFolderPath, languageName), resourceName);

            return(File.Exists(path));
        }
 public static string GetScriptResourcesRootFolderPath(string exchangeInstallPath, string resourcesRelativeFolderPath)
 {
     return(Path.Combine(exchangeInstallPath, string.Format("ClientAccess\\Owa\\{0}", ResourcePathBuilderUtilities.GetScriptResourcesRelativeFolderPath(resourcesRelativeFolderPath))));
 }