ContentTypeIsValid() public static méthode

public static ContentTypeIsValid ( string contentType ) : void
contentType string
Résultat void
        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);
        }
Exemple #2
0
        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);
        }