public static SlabManifest Load(string folder, string slabManifestFileName, Action <string, Exception> logError, string manifestDiskRelativeFolderPath)
        {
            string       text = Path.Combine(folder, manifestDiskRelativeFolderPath, slabManifestFileName);
            SlabManifest result;

            try
            {
                XmlDocument xmlDocument = new XmlDocument();
                try
                {
                    xmlDocument.Load(text);
                    result = SlabManifestLoader.Load(xmlDocument, text, delegate(string param0, Exception param1)
                    {
                    });
                }
                catch (XmlException ex)
                {
                    throw new SlabManifestFormatException(ex.Message, ex);
                }
            }
            catch (SlabManifestException arg)
            {
                logError(text, arg);
                throw;
            }
            return(result);
        }
示例#2
0
        // Token: 0x06002826 RID: 10278 RVA: 0x000947CC File Offset: 0x000929CC
        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]);
        }