示例#1
0
        /// <summary>
        /// Loads manifest from stream and then writes the manifest contents onto a file
        /// This utility is used for Loading the in stream manifest
        /// </summary>
        /// <param name="manifestData">Memory stream containing cached contents of manifest</param>
        internal void LoadManifest(byte[] manifestData)
        {
            if (string.IsNullOrEmpty(this.dynamicManifestFolder))
            {
                return;
            }

            var loader = new ManifestLoader();
            ICollection <ProviderDefinitionDescription> providers;

            using (MemoryStream memStream = new MemoryStream(manifestData))
            {
                providers = loader.LoadManifest(memStream).Providers;
            }

            List <Guid> guidList = this.GetGuidsInManifest(providers);

            // EventSource Dynamic manifest would contain only 1 guid/provider per manifest
            FileInfo fileName =
                new FileInfo(Path.Combine(this.dynamicManifestFolder, string.Format("{0}.man", guidList[0])));

            this.UnloadManifest(fileName.FullName);
            this.WriteManifest(fileName.FullName, manifestData);
            this.AddProviders(fileName.FullName, providers);
        }
示例#2
0
        public void LoadManifest(string fileName)
        {
            var loader = new ManifestLoader();

            var providers = loader.LoadManifest(fileName).Providers;

            this.AddProviders(fileName, providers);
        }