public CassetteManifest LoadCassetteManifest()
 {
     try
     {
         if (file.Exists)
         {
             using (var fileStream = file.OpenRead())
             {
                 var reader = new CassetteManifestReader(fileStream);
                 return reader.Read();
             }
         }
     }
     catch(InvalidCassetteManifestException ex)
     {
         // Swallow this exception, due to some kind of incorrect/missing data in the manifest.
         Trace.Source.TraceEvent(TraceEventType.Error, 0, ex.Message);
         // A new empty manifest will be returned.
         // Cassette should then write a new manifest based on the current bundles.
     }
     catch (XmlException ex)
     {
         // Swallow this exception, probably due to corrupt XML.
         Trace.Source.TraceEvent(TraceEventType.Error, 0, ex.Message);
         // A new empty manifest will be returned.
         // Cassette should then write a new manifest based on the current bundles.
     }
     return new CassetteManifest();
 }
Esempio n. 2
0
 public CassetteManifest LoadCassetteManifest()
 {
     try
     {
         if (file.Exists)
         {
             using (var fileStream = file.OpenRead())
             {
                 var reader = new CassetteManifestReader(fileStream);
                 return(reader.Read());
             }
         }
     }
     catch (InvalidCassetteManifestException ex)
     {
         // Swallow this exception, due to some kind of incorrect/missing data in the manifest.
         Trace.Source.TraceEvent(TraceEventType.Error, 0, ex.Message);
         // A new empty manifest will be returned.
         // Cassette should then write a new manifest based on the current bundles.
     }
     catch (XmlException ex)
     {
         // Swallow this exception, probably due to corrupt XML.
         Trace.Source.TraceEvent(TraceEventType.Error, 0, ex.Message);
         // A new empty manifest will be returned.
         // Cassette should then write a new manifest based on the current bundles.
     }
     return(new CassetteManifest());
 }
        CassetteManifest ReadManifestFromStream(Stream stream)
        {
            stream.Position = 0;
            var reader = new CassetteManifestReader(stream);

            return(reader.Read());
        }
 CassetteManifest ReadCassetteManifest()
 {
     using (var file = OpenManifestFile())
     {
         var reader = new CassetteManifestReader(file);
         var manifest = reader.Read();
         return manifest;
     }
 }
Esempio n. 5
0
 public CassetteManifest LoadCassetteManifest()
 {
     if (file.Exists)
     {
         using (var fileStream = file.OpenRead())
         {
             var reader = new CassetteManifestReader(fileStream);
             return reader.Read();
         }
     }
     return new CassetteManifest();
 }
 CassetteManifest ReadManifestFromStream(Stream stream)
 {
     stream.Position = 0;
     var reader = new CassetteManifestReader(stream);
     return reader.Read();
 }