protected internal PackagePart(Package package, Uri partUri, string contentType, CompressionOption compressionOption) { Check.Package(package); Check.PartUri(partUri); Check.ContentTypeIsValid(contentType); Package = package; Uri = partUri; ContentType = contentType; CompressionOption = compressionOption; RelationshipsPartUri = PackUriHelper.GetRelationshipPartUri(Uri); }
public PackagePart CreatePart(Uri partUri, string contentType, CompressionOption compressionOption) { CheckIsReadOnly(); Check.PartUri(partUri); Check.ContentTypeIsValid(contentType); if (PartExists(partUri)) { throw new InvalidOperationException("This partUri is already contained in the package"); } PackagePart part = CreatePartCore(partUri, contentType, compressionOption); PartsCollection.Parts.Add(part); return(part); }