示例#1
0
 public bool IsValid(Manifest manifest)
 {
     asOfDateTime = manifest.CreationDateTime;
     isValid = true;
     foreach (var bundle in manifest.Bundles)
     {
         bundle.Accept(this);
         if (!isValid) break; // Once invalid detected there's no point checking the others.
     }
     return isValid;
 }
 public void WriteManifestFile(Manifest manifest)
 {
     var manifestDocuent = new XDocument(
         new XElement(
             "BundleCollection",
             new XAttribute("Version", manifest.Version),
             new XAttribute("IsStatic", manifest.IsStatic)
         )
     );
     SerializeBundlesIntoManifest(manifest.Bundles, manifestDocuent);
     using (var manifestStream = OpenManifestFileForWriting())
     {
         var writer = XmlWriter.Create(manifestStream);
         manifestDocuent.Save(writer);
         writer.Flush();
     }
 }
 public void Write(Manifest manifest)
 {
     var writer = new BundleCollectionCacheWriter(cacheDirectory, ManifestFilename);
     writer.WriteManifestFile(manifest);
     writer.WriteBundleContentFiles(manifest.Bundles);
 }