/// <summary>
 /// Initializes a new instance of the <see cref="GedcomxOutputStream"/> class.
 /// </summary>
 /// <param name="gedxOutputStream">The underlying data stream this GEDCOM X will be written to.</param>
 /// <param name="serializer">The serializer to use when adding objects to this GEDCOM X file.</param>
 public GedcomxOutputStream(Stream gedxOutputStream, IGedcomxEntrySerializer serializer)
 {
     this.serializer = serializer;
     this.gedxOutputStream = new ZipArchive(gedxOutputStream, ZipArchiveMode.Create, false, Encoding.UTF8);
     this.mf = new ManifestAttributes(this.gedxOutputStream);
     this.mf.MainAttributes.Put("Manifest-Version", "1.0");
 }
示例#2
0
 public PSManifestAttribute(ManifestAttributes manifest)
 {
     Registry  = manifest?.Registry;
     ImageName = manifest?.ImageName;
     if (manifest != null)
     {
         Attributes = new PSManifestAttributeBase(manifest.Attributes);
     }
 }
示例#3
0
        public override PSManifestAttribute SendRequest()
        {
            ManifestAttributes manifest = _client
                                          .GetClient()
                                          .Manifests
                                          .GetAttributesAsync(_repositoryName, _manifestReference)
                                          .GetAwaiter()
                                          .GetResult();

            return(new PSManifestAttribute(manifest));
        }
示例#4
0
        public void TestManifestParsing()
        {
            var file    = TestBacking.WriteBytesToDisk(Resources.SampleGEDX);
            var fi      = new FileInfo(file);
            var results = ManifestAttributes.Parse(ZipFile.OpenRead(file));

            Assert.IsNotNull(results);
            Assert.AreEqual(4, results.Count);
            Assert.AreEqual(2, results[results.Keys.Where(x => x == ManifestAttributes.MANIFEST_FULLNAME).Single()].Count);
            Assert.AreEqual(3, results[results.Keys.Where(x => x == "tree.xml").Single()].Count);
            Assert.AreEqual(3, results[results.Keys.Where(x => x == "person1.png").Single()].Count);
            Assert.AreEqual(3, results[results.Keys.Where(x => x == "person2.png").Single()].Count);
        }
        private async Task DeleteManifestAsync(
            IAcrClient acrClient, List <string> deletedImages, Repository repository, ManifestAttributes manifest)
        {
            if (!Options.IsDryRun)
            {
                await acrClient.DeleteManifestAsync(repository.Name, manifest.Digest);
            }

            string imageId = $"{repository.Name}@{manifest.Digest}";

            _loggerService.WriteMessage($"Deleted image '{imageId}'");

            lock (deletedImages)
            {
                deletedImages.Add(imageId);
            }
        }