예제 #1
0
        /**
         * Constructor.
         * 
         * @param pack
         *            Parent package.
         * @param partName
         *            The part name, relative to the parent Package root.
         * @param contentType
         *            The content type.
         * @param loadRelationships
         *            Specify if the relationships will be loaded
         * @throws InvalidFormatException
         *             If the specified URI is not valid.
         */
        protected PackagePart(OPCPackage pack, PackagePartName partName,
                ContentType contentType, bool loadRelationships)
        {
            this.partName = partName;
            this.contentType = contentType;
            this.container = (ZipPackage)pack; // TODO - enforcing ZipPackage here - perhaps should change constructor signature

            // Check if this part is a relationship part
            isRelationshipPart = this.partName.IsRelationshipPartURI();

            // Load relationships if any
            if (loadRelationships)
                LoadRelationships();
        }
예제 #2
0
        /**
         * Constructor.
         * 
         * @param pack
         *            Parent package.
         * @param partName
         *            The part name, relative to the parent Package root.
         * @param contentType
         *            The content type.
         * @throws InvalidFormatException
         *             If the specified URI is not valid.
         */
        protected PackagePart(OPCPackage pack, PackagePartName partName,
                ContentType contentType)
            : this(pack, partName, contentType, true)
        {

        }