System.IO.Packaging
This class is used to control Compression for package parts.
Compression is turned off in this mode.
Compression is optimized for a reasonable compromise between size and performance.
Compression is optimized for size.
Compression is optimized for performance.
Compression is optimized for super performance.
Content Type class
This constructor creates a ContentType object that represents
the content-type string. At construction time we validate the
string as per the grammar specified in RFC 2616.
Note: We allow empty strings as valid input. Empty string should
we used more as an indication of an absent/unknown ContentType.
content-type
If the contentType parameter is null
If the contentType string has leading or
trailing Linear White Spaces(LWS) characters
If the contentType string invalid CR-LF characters
TypeComponent of the Content Type
If the content type is "text/xml". This property will return "text"
SubType component
If the content type is "text/xml". This property will return "xml"
Enumerator which iterates over the Parameter and Value pairs which are stored
in a dictionary. We hand out just the enumerator in order to make this property
ReadOnly
Consider following Content type -
type/subtype ; param1=value1 ; param2=value2 ; param3="value3"
This will return an enumerator over a dictionary of the parameter/value pairs.
This method does a strong comparison of the content types, as parameters are not allowed.
We only compare the type and subType values in an ASCII case-insensitive manner.
Parameters are not allowed to be present on any of the content type operands.
Content type to be compared with
This method does a weak comparison of the content types. We only compare the
type and subType values in an ASCII case-insensitive manner.
Parameter and value pairs are not used for the comparison.
If you wish to compare the parameters too, then you must get the ParameterValuePairs from
both the ContentType objects and compare each parameter entry.
The allowParameterValuePairs parameter is used to indicate whether the
comparison is tolerant to parameters being present or no.
Content type to be compared with
If true, allows the presence of parameter value pairs.
If false, parameter/value pairs cannot be present in the content type string.
In either case, the parameter value pair is not used for the comparison.
ToString - outputs a normalized form of the content type string
This method validates if the content type string has
valid CR-LF characters. Specifically we test if '\r' is
accompanied by a '\n' in the string, else its an error.
Parses the type and subType tokens from the string.
Also verifies if the Tokens are valid as per the grammar.
substring that has the type and subType of the content type
If the typeAndSubType parameter does not have the "/" character
Parse the individual parameter=value strings
This string has the parameter and value pair of the form
parameter=value
If the string does not have the required "="
This method returns the length of the first parameter value in the input string.
Starting index for parsing
Validating the given token
The following checks are being made -
1. If all the characters in the token are either ASCII letter or digit.
2. If all the characters in the token are either from the remaining allowed cha----ter set.
string token
validated string token
If the token is Empty
Validating if the value of a parameter is either a valid token or a
valid quoted string
parameter value string
validate parameter value string
If the parameter value is empty
This method validates if the text in the quoted string
Returns true if the input character is an allowed character
Returns false if the input cha----ter is not an allowed character
input character
Returns true if the input character is an ASCII digit or letter
Returns false if the input character is not an ASCII digit or letter
input character
Returns true if the input character is an ASCII letter
Returns false if the input character is not an ASCII letter
input character
Returns true if the input character is one of the Linear White Space characters -
' ', '\t', '\n', '\r'
Returns false if the input character is none of the above
input character
Lazy initialization for the ParameterDictionary
This class is used to control Encryption RM for package parts.
Encryption is turned off in this mode. This is not supported.
RightsManagement is the only supported option right now.
This class ignores all calls to Flush() and Close() methods
depending on whether the IgnoreFlushAndClose property is set to true
or false. This has been created for performance improvements for the
ZipPackage.
Constructor
Member of the abstract Stream class
Bool, true if the stream can be read from, else false
Member of the abstract Stream class
Bool, true if the stream can be seeked, else false
Member of the abstract Stream class
Bool, true if the stream can be written to, else false
Member of the abstract Stream class
Long value indicating the length of the stream
Member of the abstract Stream class
Long value indicating the current position in the stream
Member of the abstract Stream class
only zero is supported
only SeekOrigin.Begin is supported
zero
Member of the abstract Stream class
Member of the abstract Stream class
The standard Stream.Read semantics, and in particular the restoration of the current
position in case of an exception, is implemented by the underlying stream.
Member of the abstract Stream class
Member of the abstract Stream class
Dispose(bool)
Collection of all the relationships corresponding to a given source PackagePart
Returns an enumerator over all the relationships for a Package or a PackagePart
Returns an enumerator over all the relationships for a Package or a PackagePart
Constructor
For use by PackagePart
Constructor
For use by Package
Add new relationship
target
Enumeration indicating the base uri for the target uri
relationship type that uniquely defines the role of the relationship
String that conforms to the xsd:ID datatype. Unique across the source's relationships.
Null OK (ID will be generated).
Return the relationship whose id is 'id', and null if not found.
Delete relationship with ID 'id'
ID of the relationship to remove
Clear all the relationships in this collection
Today it is only used when the entire relationship part is being deleted
Flush to stream (destructive)
Flush part.
Constructor
package
part will be null if package is the source of the relationships
Shared constructor
Returns the associated RelationshipPart for this part
may be null
name of relationship part for the given part
Parse PackageRelationship Stream
relationship part
Thrown if XML is malformed
Add new relationship to the Collection
target
Enumeration indicating the base uri for the target uri
relationship type that uniquely defines the role of the relationship
String that conforms to the xsd:ID datatype. Unique across the source's relationships.
Null OK (ID will be generated).
Indicates whether the add call is made while parsing existing relationships
from a relationship part, or we are adding a new relationship
Write PackageRelationship Stream
part to persist to
Write one Relationship element for each member of relationships.
This method is used by XmlDigitalSignatureProcessor code as well
Ensures that the PackageRelationship PackagePart has been created - lazy init
Resolves the target uri in the relationship against the source part or the
package root. This resolved Uri is then used by the Add method to figure
out if a relationship is being created to another relationship part.
PackageRelationship target uri
Enum value specifying the interpretation of the base uri
for the relationship target uri
Resolved Uri
A collection that ensures uniqueness among a list of elements while maintaining the order in which the elements were added.
This is similar to , but the items will not be sorted by a comparer but rather retain the
order in which they were added while still retaining good lookup, insertion, and removal.
Abstract Base class for the Package.
This is a part of the Packaging Layer APIs
Protected constructor for the abstract Base class.
This is the current contract between the subclass and the base class
If we decide some registration mechanism then this might change
If FileAccess enumeration does not have one of the valid values
Gets the FileAccess with which the package was opened. This is a read only property.
This property gets set when the package is opened.
FileAccess
If this Package object has been disposed
The package properties are a subset of the standard OLE property sets
SummaryInformation and DocumentSummaryInformation, and include such properties
as Title and Subject.
If this Package object has been disposed
Opens a package at the specified Path. This method calls the overload which accepts all the parameters
with the following defaults -
FileMode - FileMode.OpenOrCreate,
FileAccess - FileAccess.ReadWrite
FileShare - FileShare.None
Path to the package
Package
If path parameter is null
Opens a package at the specified Path in the given mode. This method calls the overload which
accepts all the parameters with the following defaults -
FileAccess - FileAccess.ReadWrite
FileShare - FileShare.None
Path to the package
FileMode in which the package should be opened
Package
If path parameter is null
If FileMode enumeration [packageMode] does not have one of the valid values
Opens a package at the specified Path in the given mode with the specified access. This method calls
the overload which accepts all the parameters with the following defaults -
FileShare - FileShare.None
Path to the package
FileMode in which the package should be opened
FileAccess with which the package should be opened
Package
If path parameter is null
If FileMode enumeration [packageMode] does not have one of the valid values
If FileAccess enumeration [packageAccess] does not have one of the valid values
Open a package on this stream. This method calls the overload which accepts all the parameters
with the following defaults -
FileMode - FileMode.Open
FileAccess - FileAccess.Read
Stream on which the package is to be opened
Package
If stream parameter is null
If package to be created should have readwrite/read access and underlying stream is write only
If package to be created should have readwrite/write access and underlying stream is read only
Open a package on this stream. This method calls the overload which accepts all the parameters
with the following defaults -
FileAccess - FileAccess.ReadWrite
Stream on which the package is to be opened
FileMode in which the package should be opened.
Package
If stream parameter is null
If FileMode enumeration [packageMode] does not have one of the valid values
If package to be created should have readwrite/read access and underlying stream is write only
If package to be created should have readwrite/write access and underlying stream is read only
Creates a new part in the package. An empty stream corresponding to this part will be created in the
package. If a part with the specified uri already exists then we throw an exception.
This methods will call the CreatePartCore method which will create the actual PackagePart in the package.
Uri of the PackagePart that is to be added
ContentType of the stream to be added
If this Package object has been disposed
If the package is readonly, it cannot be modified
If partUri parameter is null
If contentType parameter is null
If partUri parameter does not conform to the valid partUri syntax
If a PackagePart with the given partUri already exists in the Package
Creates a new part in the package. An empty stream corresponding to this part will be created in the
package. If a part with the specified uri already exists then we throw an exception.
This methods will call the CreatePartCore method which will create the actual PackagePart in the package.
Uri of the PackagePart that is to be added
ContentType of the stream to be added
CompressionOption describing compression configuration
for the new part. This compression apply only to the part, it doesn't affect relationship parts or related parts.
This parameter is optional.
If this Package object has been disposed
If the package is readonly, it cannot be modified
If partUri parameter is null
If contentType parameter is null
If partUri parameter does not conform to the valid partUri syntax
If CompressionOption enumeration [compressionOption] does not have one of the valid values
If a PackagePart with the given partUri already exists in the Package
Returns a part that already exists in the package. If the part
Corresponding to the URI does not exist in the package then an exception is
thrown. The method calls the GetPartCore method which actually fetches the part.
If this Package object has been disposed
If the package is write only, information cannot be retrieved from it
If partUri parameter is null
If partUri parameter does not conform to the valid partUri syntax
If the requested part does not exists in the Package
This is a convenient method to check whether a given part exists in the
package. This will have a default implementation that will try to retrieve
the part and then if successful, it will return true.
If the custom file format has an easier way to do this, they can override this method
to get this information in a more efficient way.
If this Package object has been disposed
If the package is write only, information cannot be retrieved from it
If partUri parameter is null
If partUri parameter does not conform to the valid partUri syntax
This method will do all the house keeping required when a part is deleted
Then the DeletePartCore method will be called which will have the actual logic to
do the work specific to the underlying file format and will actually delete the
stream corresponding to this part. This method does not throw if the specified
part does not exist. This is in conformance with the FileInfo.Delete call.
If this Package object has been disposed
If the package is readonly, it cannot be modified
If partUri parameter is null
If partUri parameter does not conform to the valid partUri syntax
This returns a collection of all the Parts within the package.
If this Package object has been disposed
If the package is writeonly, no information can be retrieved from it
Member of the IDisposable interface. This method will clean up all the resources.
It calls the Flush method to make sure that all the changes made get persisted.
Note - subclasses should only override Dispose(bool) if they have resources to release.
See the Design Guidelines for the Dispose() pattern.
Closes the package and all the underlying parts and relationships.
Calls the Dispose Method, since they have the same semantics
Flushes the contents of the parts and the relationships to the package.
This method will call the FlushCore method which will do the actual flushing of contents.
If this Package object has been disposed
If the package is readonly, it cannot be modified
Creates a relationship at the Package level with the Target PackagePart specified as the Uri
Target's URI
Enumeration indicating the base uri for the target uri
PackageRelationship type, having uri like syntax that is used to
uniquely identify the role of the relationship
If this Package object has been disposed
If the package is readonly, it cannot be modified
If parameter "targetUri" is null
If parameter "relationshipType" is null
If parameter "targetMode" enumeration does not have a valid value
If TargetMode is TargetMode.Internal and the targetUri is an absolute Uri
If relationship is being targeted to a relationship part
Creates a relationship at the Package level with the Target PackagePart specified as the Uri
Target's URI
Enumeration indicating the base uri for the target uri
PackageRelationship type, having uri like syntax that is used to
uniquely identify the role of the relationship
String that conforms to the xsd:ID datatype. Unique across the source's
relationships. Null is OK (ID will be generated). An empty string is an invalid XML ID.
If this Package object has been disposed
If the package is readonly, it cannot be modified
If parameter "targetUri" is null
If parameter "relationshipType" is null
If parameter "targetMode" enumeration does not have a valid value
If TargetMode is TargetMode.Internal and the targetUri is an absolute Uri
If relationship is being targeted to a relationship part
If parameter "id" is not a valid Xsd Id
If an id is provided in the method, and its not unique
Deletes a relationship from the Package. This is done based on the
relationship's ID. The target PackagePart is not affected by this operation.
The ID of the relationship to delete. An invalid ID will not
throw an exception, but nothing will be deleted.
If this Package object has been disposed
If the package is readonly, it cannot be modified
If parameter "id" is null
If parameter "id" is not a valid Xsd Id
Returns a collection of all the Relationships that are
owned by the package
If this Package object has been disposed
If the package is write only, no information can be retrieved from it
Returns a collection of filtered Relationships that are
owned by the package
The filter string is compared with the type of the relationships
in a case sensitive and culture ignorant manner.
If this Package object has been disposed
If the package is write only, no information can be retrieved from it
If parameter "relationshipType" is null
If parameter "relationshipType" is an empty string
Retrieve a relationship per ID.
The relationship ID.
The relationship with ID 'id' or throw an exception if not found.
If this Package object has been disposed
If the package is write only, no information can be retrieved from it
If parameter "id" is null
If parameter "id" is not a valid Xsd Id
If the requested relationship does not exist in the Package
Returns whether there is a relationship with the specified ID.
The relationship ID.
true iff a relationship with ID 'id' is defined on this source.
If this Package object has been disposed
If the package is write only, no information can be retrieved from it
If parameter "id" is null
If parameter "id" is not a valid Xsd Id
This method is for custom implementation corresponding to the underlying file format.
This method will actually add a new part to the package. An empty part should be
created as a result of this call.
This method is for custom implementation corresponding to the underlying file format.
This method will actually return the part after reading the actual physical bits.
If the PackagePart does not exists in the underlying package then this method should return a null.
This method must not throw an exception if a part does not exist.
This method is for custom implementation corresponding to the underlying file format.
This method will actually delete the part from the underlying package.
This method should not throw if the specified part does not exist.
This is in conformance with the FileInfo.Delete call.
This method is for custom implementation corresponding to the underlying file format.
This is the method that knows how to get the actual parts. If there are no parts,
this method should return an empty array.
This method is for custom implementation corresponding to the underlying file format.
This method should be used to dispose the resources that are specific to the file format.
Also everything should be flushed to the disc before closing the package.
Subclasses that manage non-memory resources should override this method and free these resources.
Any override should be careful to always call base.Dispose(disposing) to ensure orderly cleanup.
This method is for custom implementation corresponding to the underlying file format.
This method flushes the contents of the package to the disc.
Path to the package.
FileMode in which the package should be opened.
FileAccess with which the package should be opened.
FileShare with which the package is opened.
Package
If path parameter is null
If FileAccess enumeration [packageAccess] does not have one of the valid values
If FileMode enumeration [packageMode] does not have one of the valid values
Stream on which the package is created
FileMode in which the package is to be opened
FileAccess on the package that is opened
Package
If stream parameter is null
If FileMode enumeration [packageMode] does not have one of the valid values
If FileAccess enumeration [packageAccess] does not have one of the valid values
If package to be created should have readwrite/read access and underlying stream is write only
If package to be created should have readwrite/write access and underlying stream is read only
Retrieve a relationship per ID.
The relationship ID.
The relationship with ID 'id' or null if not found.
Returns a collection of all the Relationships that are
owned by the package based on the filter string.
This class represents the a PackagePart within a container.
This is a part of the Packaging Layer APIs
Protected constructor for the abstract Base class.
This is the current contract between the subclass and the base class
If we decide some registration mechanism then this might change
You should use this constructor in the rare case when you do not have
the content type information related to this part and would prefer to
obtain it later as required.
These parts have the CompressionOption as NotCompressed by default.
NOTE : If you are using this constructor from your subclass or passing a null
for the content type parameter, be sure to implement the GetContentTypeCore
method, as that will be called to get the content type value. This is provided
to enable lazy initialization of the ContentType property.
Package in which this part is being created
uri of the part
If parameter "package" is null
If parameter "partUri" is null
Protected constructor for the abstract Base class.
This is the current contract between the subclass and the base class
If we decide some registration mechanism then this might change
These parts have the CompressionOption as NotCompressed by default.
NOTE : If you are using this constructor from your subclass or passing a null
for the content type parameter, be sure to implement the GetContentTypeCore
method, as that will be called to get the content type value. This is provided
to enable lazy initialization of the ContentType property.
Package in which this part is being created
uri of the part
Content Type of the part, can be null if the value
is unknown at the time of construction. However the value has to be made
available anytime the ContentType property is called. A null value only indicates
that the value will be provided later. Every PackagePart must have a valid
Content Type
If parameter "package" is null
If parameter "partUri" is null
If parameter "partUri" does not conform to the valid partUri syntax
Protected constructor for the abstract Base class.
This is the current contract between the subclass and the base class
If we decide some registration mechanism then this might change
NOTE : If you are using this constructor from your subclass or passing a null
for the content type parameter, be sure to implement the GetContentTypeCore
method, as that will be called to get the content type value. This is provided
to enable lazy initialization of the ContentType property.
Package in which this part is being created
uri of the part
Content Type of the part, can be null if the value
is unknown at the time of construction. However the value has to be made
available anytime the ContentType property is called. A null value only indicates
that the value will be provided later. Every PackagePart must have a valid
Content Type
compression option for this part
If parameter "package" is null
If parameter "partUri" is null
If CompressionOption enumeration [compressionOption] does not have one of the valid values
If parameter "partUri" does not conform to the valid partUri syntax
The Uri for this PackagePart. It is always relative to the Package Root
The PackagePart properties can not be accessed if the parent container is closed.
If this part has been deleted
If the parent package has been closed or disposed
The Content type of the stream that is represented by this part.
The PackagePart properties can not be accessed if the parent container is closed.
The content type value can be provided by the underlying physical format
implementation at the time of creation of the Part object ( constructor ) or
We can initialize it in a lazy manner when the ContentType property is called
called for the first time by calling the GetContentTypeCore method.
Note: This method GetContentTypeCore() is only for lazy initialization of the Content
type value and will only be called once. There is no way to change the content type of
the part once it has been assigned.
Content Type of the Part [can never return null]
If this part has been deleted
If the parent package has been closed or disposed
If the subclass fails to provide a non-null content type value.
The parent container for this PackagePart
The PackagePart properties can not be accessed if the parent container is closed.
If this part has been deleted
If the parent package has been closed or disposed
CompressionOption class that was provided as a parameter during the original CreatePart call.
The PackagePart properties can not be accessed if the parent container is closed.
If this part has been deleted
If the parent package has been closed or disposed
Custom Implementation for the GetContentType Method
This method should only be implemented by those physical format implementors where
the value for the content type cannot be provided at the time of construction of
Part object and if calculating the content type value is a non-trivial or costly
operation. The return value has to be a valid ContentType. This method will be used in
real corner cases. The most common usage should be to provide the content type in the
constructor.
This method is only for lazy initialization of the Content type value and will only
be called once. There is no way to change the content type of the part once it is
assigned.
Content type for the Part
By default, this method throws a NotSupportedException. If a subclass wants to
initialize the content type for a PackagePart in a lazy manner they must override this method.
Returns the underlying stream that is represented by this part
with the default FileMode and FileAccess
Note: If you are requesting a stream for a relationship part and
at the same time using relationship APIs to manipulate relationships,
the final persisted data will depend on which data gets flushed last.
If this part has been deleted
If the parent package has been closed or disposed
If the subclass fails to provide a non-null stream object
Returns the underlying stream in the specified mode and the
default FileAccess
Note: If you are requesting a stream for a relationship part for editing
and at the same time using relationship APIs to manipulate relationships,
the final persisted data will depend on which data gets flushed last.
If this part has been deleted
If the parent package has been closed or disposed
If FileMode enumeration [mode] does not have one of the valid values
If FileAccess.Read is provided and FileMode values are any of the following -
FileMode.Create, FileMode.CreateNew, FileMode.Truncate, FileMode.Append
If the mode and access for the Package and the Stream are not compatible
If the subclass fails to provide a non-null stream object
Returns the underlying stream that is represented by this part
in the specified mode with the access.
Note: If you are requesting a stream for a relationship part and
at the same time using relationship APIs to manipulate relationships,
the final persisted data will depend on which data gets flushed last.
If this part has been deleted
If the parent package has been closed or disposed
If FileMode enumeration [mode] does not have one of the valid values
If FileAccess enumeration [access] does not have one of the valid values
If FileAccess.Read is provided and FileMode values are any of the following -
FileMode.Create, FileMode.CreateNew, FileMode.Truncate, FileMode.Append
If the mode and access for the Package and the Stream are not compatible
If the subclass fails to provide a non-null stream object
Custom Implementation for the GetSream Method
Adds a relationship to this PackagePart with the Target PackagePart specified as the Uri
Initial and trailing spaces in the name of the PackageRelationship are trimmed.
Enumeration indicating the base uri for the target uri
PackageRelationship type, having uri like syntax that is used to
uniquely identify the role of the relationship
If this part has been deleted
If the parent package has been closed or disposed
If the package is readonly, it cannot be modified
If parameter "targetUri" is null
If parameter "relationshipType" is null
If parameter "targetMode" enumeration does not have a valid value
If TargetMode is TargetMode.Internal and the targetUri is an absolute Uri
If relationship is being targeted to a relationship part
Adds a relationship to this PackagePart with the Target PackagePart specified as the Uri
Initial and trailing spaces in the name of the PackageRelationship are trimmed.
Enumeration indicating the base uri for the target uri
PackageRelationship type, having uri like syntax that is used to
uniquely identify the role of the relationship
String that conforms to the xsd:ID datatype. Unique across the source's
relationships. Null is OK (ID will be generated). An empty string is an invalid XML ID.
If this part has been deleted
If the parent package has been closed or disposed
If the package is readonly, it cannot be modified
If parameter "targetUri" is null
If parameter "relationshipType" is null
If parameter "targetMode" enumeration does not have a valid value
If TargetMode is TargetMode.Internal and the targetUri is an absolute Uri
If relationship is being targeted to a relationship part
If parameter "id" is not a valid Xsd Id
If an id is provided in the method, and its not unique
Deletes a relationship from the PackagePart. This is done based on the
relationship's ID. The target PackagePart is not affected by this operation.
The ID of the relationship to delete. An invalid ID will not
throw an exception, but nothing will be deleted.
If this part has been deleted
If the parent package has been closed or disposed
If the package is readonly, it cannot be modified
If parameter "id" is null
If parameter "id" is not a valid Xsd Id
Returns a collection of all the Relationships that are
owned by this PackagePart
If this part has been deleted
If the parent package has been closed or disposed
If the package is write only, no information can be retrieved from it
Returns a collection of filtered Relationships that are
owned by this PackagePart
The relationshipType string is compared with the type of the relationships
in a case sensitive and culture ignorant manner.
If this part has been deleted
If the parent package has been closed or disposed
If the package is write only, no information can be retrieved from it
If parameter "relationshipType" is null
If parameter "relationshipType" is an empty string
Retrieve a relationship per ID.
The relationship ID.
The relationship with ID 'id' or throw an exception if not found.
If this part has been deleted
If the parent package has been closed or disposed
If the package is write only, no information can be retrieved from it
If parameter "id" is null
If parameter "id" is not a valid Xsd Id
If the requested relationship does not exist in the Package
Returns whether there is a relationship with the specified ID.
The relationship ID.
true iff a relationship with ID 'id' is defined on this source.
If this part has been deleted
If the parent package has been closed or disposed
If the package is write only, no information can be retrieved from it
If parameter "id" is null
If parameter "id" is not a valid Xsd Id
This property returns the content type of the part
as a validated strongly typed ContentType object
write the relationships part
Retrieve a relationship per ID.
The relationship ID.
The relationship with ID 'id' or null if not found.
Returns a collection of all the Relationships that are
owned by this PackagePart, based on the filter string
This class is used to get an enumerator for the Parts in a container.
This is a part of the MMCF Packaging Layer APIs
Returns an enumerator over all the Parts in the container
Returns an enumerator over all the Parts in the container
Returns an enumerator over all the Parts in the Container
This class provides access to the "core properties", such as Title and
Subject, of an RM-protected XPS package. These properties are a subset of
of the standard OLE property sets SummaryInformation and
DocumentSummaryInformation.
Allow the object to clean up all resources it holds (both managed and
unmanaged), and ensure that the resources won't be released a
second time by removing it from the finalization queue.
This default implementation is provided for subclasses that do not
make use of the IDisposable functionality.
The title.
The topic of the contents.
The primary creator. The identification is environment-specific and
can consist of a name, email address, employee ID, etc. It is
recommended that this value be only as verbose as necessary to
identify the individual.
A delimited set of keywords to support searching and indexing. This
is typically a list of terms that are not available elsewhere in the
properties.
The description or abstract of the contents.
The user who performed the last modification. The identification is
environment-specific and can consist of a name, email address,
employee ID, etc. It is recommended that this value be only as
verbose as necessary to identify the individual.
The revision number. This value indicates the number of saves or
revisions. The application is responsible for updating this value
after each revision.
The date and time of the last printing.
The creation date and time.
The date and time of the last modification.
The category. This value is typically used by UI applications to create navigation
controls.
A unique identifier.
The type of content represented, generally defined by a specific
use and intended audience. Example values include "Whitepaper",
"Security Bulletin", and "Exam". (This property is distinct from
MIME content types as defined in RFC 2045.)
The primary language of the package content. The language tag is
composed of one or more parts: A primary language subtag and a
(possibly empty) series of subsequent subtags, for example, "EN-US".
These values MUST follow the convention specified in RFC 3066.
The version number. This value is set by the user or by the application.
The status of the content. Example values include "Draft",
"Reviewed", and "Final".
This class is used to express a relationship between a source and a target part.
The only way to create a PackageRelationship, is to call the PackagePart.CreateRelationship()
or Package.CreateRelationship(). A relationship is owned by a part or by the package itself.
If the source part is deleted all the relationships it owns are also deleted.
A target of the relationship need not be present.
This class is part of the MMCF Packaging layer.
This is a reference to the parent PackagePart to which this relationship belongs.
Uri
Uri of the TargetPart, that this relationship points to.
Type of the relationship - used to uniquely define the role of the relationship
Enumeration value indicating the interpretations of the "base" of the target uri.
PackageRelationship's identifier. Unique across relationships for the given source.
String
PackageRelationship's owning Package object.
Package
PackageRelationship constructor
Owning Package object for this relationship
owning part - will be null if the owner is the container
target of relationship
enum specifying the interpretation of the base uri for the target uri
type name
unique identifier
Collection of all the relationships corresponding to a given source PackagePart.
This class is part of the MMCF Packaging Layer. It handles serialization to/from
relationship parts, creation of those parts and offers methods to create, delete
and enumerate relationships.
Returns an enumerator for all the relationships for a PackagePart
Returns an enumerator over all the relationships for a PackagePart
Constructor
For use by PackagePart
Internal class for the FilteredEnumerator
Constructs a FilteredEnumerator
This method keeps moving the enumerator the next position till
a relationship is found with the matching Name
Bool indicating if the enumerator successfully moved to the next position
Gets the current object in the enumerator
Resets the enumerator to the beginning
Gets the current object in the enumerator
This class is used to represent a PackageRelationship selector. PackageRelationships can be
selected based on their Type or ID. This class will specify what the selection is based on and
what the actual criteria is.
Constructor
Source Uri of the PackagePart or PackageRoot ("/") that owns the relationship
PackageRelationshipSelectorType enum representing the type of the selectionCriteria
The actual string that is used to select the relationships
If sourceUri is null
If selectionCriteria is null
If selectorType Enumeration does not have a valid value
If PackageRelationshipSelectorType.Id and selection criteria is not valid Xsd Id
If PackageRelationshipSelectorType.Type and selection criteria is not valid relationship type
If sourceUri is not "/" to indicate the PackageRoot, then it must conform to the
valid PartUri syntax
This is a uri to the parent PackagePart to which this relationship belongs.
PackagePart
Enumeration value indicating the interpretations of the SelectionCriteria.
Selection Criteria - actual value (could be ID or type) on which the selection is based
This method returns the list of selected PackageRelationships as per the
given criteria, from a part in the Package provided
Package object from which we get the relationships
If package parameter is null
Enum to represent the different selector types for PackageRelationshipSelector
Id
Type
This method is used to determine if we support a given Encoding as per the
OPC and XPS specs. Currently the only two encodings supported are UTF-8 and
UTF-16 (Little Endian and Big Endian)
XmlReader
This method returns the count of xml attributes other than:
1. xmlns="namespace"
2. xmlns:someprefix="namespace"
Reader should be positioned at the Element whose attributes
are to be counted.
An integer indicating the number of non-xmlns attributes
Synchronize access to IsolatedStorage methods that can step on each-other
See PS 1468964 for details.
This class has the utility methods for composing and parsing an Uri of pack:// scheme
This class has the utility methods for composing and parsing an Uri of pack:// scheme
This method is used to create a valid part Uri given a relative URI
Makes sure that the URI -
1. Relative
2. Begins with '/'
3. Does not begin with two "//"
4. Does not end with "/"
5. Does not have a fragment component
6. Does the correct escaping
7. And is refined correctly
The relative uri that represents the part within a package
Returns a relative URI with an absolute path that points to a part within a package
If partUri parameter is null
If partUri parameter is an absolute Uri
If partUri parameter is empty
If partUri parameter ends with "/"
If partUri parameter starts with two "/"
If partUri parameter has a fragment
This method is used to resolve part Uris
Constructs resolved relative URI from two relative URIs
This method should be used in places where we have a
a target URI in the PackageRelationship and we want to get the
name of the part it targets with respect to the source part
This should be a valid partName.
The only exception to this rule is an Uri of the form "/". This uri
will only be used to resolve package level relationships. This Uri
indicates that the relative Uri is being resolved against the root of the
package.
This URI can be any relative URI
If either sourcePartUri or targetUri parameter is null
If either sourcePartUri or targetUri parameter is an absolute Uri
If sourcePartUri parameter does not conform to the valid partUri syntax
This method returns the relative uri between two given parts
The relative path between two parts
If either the sourcePartUri or targetPartUri parameter is null
If either sourcePartUri or targetPartUri parameter does not conform to the valid partUri syntax
Returns the normalized form of the part URI
Part Uri
Normalized Part Uri
If partUri is null
If partUri parameter does not conform to the valid partUri syntax
This method compares two part uris and returns an int to indicate the equivalence
Null values are allowed
First part Uri to be compared
Second part Uri to be compared
A 32-bit signed integer indicating the lexical relationship between the compared Uri components.
Value - Less than zero means firstUri is less than secondUri
Value - Equal to zero means both the Uris are equal
Value - Greater than zero means firstUri is greater than secondUri
If firstPartUri or secondPartUri parameter does not conform to the valid partUri syntax
IsRelationshipPartUri method returns a boolean indicating whether the
Uri given is a relationship part Uri or not.
uri of part to evaluate
true if the given part is a PackageRelationship part
Does not inspect the part contents - this is based solely on the name
If partUri parameter is null
If partUri parameter is an absolute Uri
If partUri parameter does not conform to the valid partUri Syntax
This method returns a relationship part Uri given a part Uri
Example Input - partUri - /files/document.xaml
Return - Relationship Uri - /files/_rels/document.xaml.rels
If the input to the method is Uri - "/", then we will return /_rels/.rels as the
relationship part Uri for the Package level relationships
Part Uri for which the relationship part Uri is wanted
returns a Uri that conforms to the relationship part Uri syntax
If the input Uri is a relationship part Uri itself
If partUri parameter is null
If partUri parameter is an absolute Uri
If partUri parameter does not conform to the valid partUri Syntax
Given a valid relationship Part Uri, this method returns the source Part Uri for
this relationship Part Uri.
If the relationship part name is for the Package Level relationships [/_rels/.rels],
we return a relative Uri of the form "/" indicating that it has no part as the parent,
but is at the package level
Example Input - Relationship Uri - /files/_rels/document.xaml.rels
Returns -Source Part Uri - /files/document.xaml
relationship part Uri
A uri that is a valid source part Uri for the relationship Uri provided
If relationshipPartUri parameter is null
If relationshipPartUri parameter is an absolute Uri
If relationshipPartUri parameter does not conform to the valid partUri Syntax
If the relationshipPartUri is not a relationship part Uri itself
If the resultant Uri obtained is a relationship part Uri
This method is used to validate a part Uri
This method does not perform a case sensitive check of the Uri
The string that represents the part within a package
Returns the part uri if it is valid
If partUri parameter is null
If partUri parameter is an absolute Uri
If partUri parameter is empty
If partUri parameter does not start with a "/"
If partUri parameter starts with two "/"
If partUri parameter ends with a "/"
If partUri parameter has a fragment
If partUri parameter has some escaped characters that should not be escaped
or some characters that should be escaped are not escaped.
pack scheme name
ValidatedPartUri class
Once the partUri has been validated as per the syntax in the OPC spec
we create a ValidatedPartUri, this way we do not have to re-validate
this.
This class is heavily used throughout the Packaging APIs and in order
to reduce the parsing and number of allocations for Strings and Uris
we cache the results after parsing.
This method is used to create a valid pack Uri
This is the uri that points to the entire package.
This parameter should be an absolute Uri. This parameter cannot be null or empty
This method will create a valid pack uri that references the entire package
A Uri with the "pack://" scheme
If packageUri parameter is null
If packageUri parameter is not an absolute Uri
This method is used to create a valid pack Uri
This is the uri that points to the entire package.
This parameter should be an absolute Uri. This parameter cannot be null or empty
This is the uri that points to the part within the package
This parameter should be a relative Uri.
This parameter can be null in which case we will create a valid pack uri
that references the entire package
A Uri with the "pack://" scheme
If packageUri parameter is null
If packageUri parameter is not an absolute Uri
If partUri parameter does not conform to the valid partUri syntax
This method is used to create a valid pack Uri
This is the uri that points to the entire package.
This parameter should be an absolute Uri. This parameter cannot be null or empty
This is the uri that points to the part within the package
This parameter should be a relative Uri.
This parameter can be null in which case we will create a valid pack uri
that references the entire package
Fragment for the resulting Pack URI. This parameter can be null
The fragment string must start with a "#"
A Uri with the "pack://" scheme
If packageUri parameter is null
If packageUri parameter is not an absolute Uri
If partUri parameter does not conform to the valid partUri syntax
If fragment parameter is empty or does not start with a "#"
This method parses the pack uri and returns the inner
Uri that points to the package as a whole.
Uri which has pack:// scheme
Returns the inner uri that points to the entire package
If packUri parameter is null
If packUri parameter is not an absolute Uri
If packUri parameter does not have "pack://" scheme
If inner packageUri extracted from the packUri has a fragment component
This method parses the pack uri and returns the absolute
path of the URI. This corresponds to the part within the
package. This corresponds to the absolute path component in
the Uri. If there is no part component present, this method
returns a null
Returns a relative Uri that represents the
part within the package. If the pack Uri points to the entire
package then we return a null
Returns a relative URI with an absolute path that points to a part within a package
If packUri parameter is null
If packUri parameter is not an absolute Uri
If packUri parameter does not have "pack://" scheme
If partUri extracted from packUri does not conform to the valid partUri syntax
This method compares two pack uris and returns an int to indicate the equivalence.
First Uri of pack:// scheme to be compared
Second Uri of pack:// scheme to be compared
A 32-bit signed integer indicating the lexical relationship between the compared Uri components.
Value - Less than zero means firstUri is less than secondUri
Value - Equal to zero means both the Uris are equal
Value - Greater than zero means firstUri is greater than secondUri
If either of the Uris are not absolute or if either of the Uris are not with pack:// scheme
If firstPackUri or secondPackUri parameter is not an absolute Uri
If firstPackUri or secondPackUri parameter does not have "pack://" scheme
This method is used to validate the package uri
Escapes - %', '@', ',', '?' in the package URI
This method modifies the string in a culture safe and case safe manner.
The package properties are a subset of the standard OLE property sets
SummaryInformation and DocumentSummaryInformation, and include such properties
as Title and Subject.
Setting a property to null deletes this property. 'null' is never strictly speaking
a property value, but an absence indicator.
The primary creator. The identification is environment-specific and
can consist of a name, email address, employee ID, etc. It is
recommended that this value be only as verbose as necessary to
identify the individual.
The title.
The topic of the contents.
The category. This value is typically used by UI applications to create navigation
controls.
A delimited set of keywords to support searching and indexing. This
is typically a list of terms that are not available elsewhere in the
properties.
The description or abstract of the contents.
The type of content represented, generally defined by a specific
use and intended audience. Example values include "Whitepaper",
"Security Bulletin", and "Exam". (This property is distinct from
MIME content types as defined in RFC 2616.)
The status of the content. Example values include "Draft",
"Reviewed", and "Final".
The version number. This value is set by the user or by the application.
The revision number. This value indicates the number of saves or
revisions. The application is responsible for updating this value
after each revision.
The creation date and time.
The date and time of the last modification.
The user who performed the last modification. The identification is
environment-specific and can consist of a name, email address,
employee ID, etc. It is recommended that this value be only as
verbose as necessary to identify the individual.
The date and time of the last printing.
A language of the intellectual content of the resource
A unique identifier.
The TargetMode enumeration is used to interpret the
"base" uri for the PackageRelationship target Uri.
Possible values -
0: "Internal" - target points to a part within the package
PackageRelationship target uri must be relative.
1: "External" - target points to an external resource. The
resource can be relative to the package entity
or an absolute URI
TargetMode is "Internal".
PackageRelationship target points to a part within the package
PackageRelationship target uri must be relative.
TargetMode is "External".
PackageRelationship target points to an external resource.
PackageRelationship target uri can be relative or absolute.
The resource can be relative to the package entity or an absolute URI.
replaces all future references of namespace URI 'oldNamespace' with 'newNamespace'
the namespace to subsume with
the namespace to be subsumed
Reads the next node from the stream.
true if the next node was read successfully; false if there are no more nodes to read.
Used to handle 'start element' tags. These are actually
just called 'element' tags, the 'start' is just for clarity
is set to true if there is the document contains more elements, false if the end of the
document has been reached.
true if an element was read that should not be ignored
false if the element read should be ignored or the end of document has been reached
Used to handle any end element tag
is set to true if there is the document contains more elements, false if the end of the
document has been reached.
true if an element was read that should not be ignored
false if the element read should be ignored or the end of document has been reached
Gets the value of the attribute with the specified index.
The index of the attribute. The index is zero-based. (The first attribute has index 0.)
The value of the specified attribute. If the attribute is not found, a null reference is returned.
Gets the value of the attribute with the specified name.
The qualified name of the attribute.
The value of the specified attribute. If the attribute is not found, a null reference is returned.
Gets the value of the attribute with the specified local name and namespace URI.
The local name of the attribute.
The namespace URI of the attribute.
The value of the specified attribute. If the attribute is not found, a null reference is returned.
Gets the value of the attribute with the specified index.
The index of the attribute. The index is zero-based. (The first attribute has index 0.)
Moves to the attribute with the specified name.
The qualified name of the attribute.
true if the attribute is found; otherwise, false. If false, the reader's position does not change.
Moves to the attribute with the specified local name and namespace URI.
The local name of the attribute.
The namespace URI of the attribute.
true if the attribute is found; otherwise, false. If false, the reader's position does not change.
Moves to the first attribute.
true if an attribute exists (the reader moves to the first attribute);
otherwise, false (the position of the reader does not change).
Moves to the next attribute.
true if there is a next attribute; false if there are no more attributes.
Resolves a namespace prefix in the current element's scope.
The prefix whose namespace URI you want to resolve. To match the default namespace,
pass an empty string. This string does not have to be atomized.
The namespace URI to which the prefix maps or a null reference if no matching prefix is found.
This override is to ensure that the value
for the xmlns attribute reflects all the
compatibility (subsuming) rules.
Gets the namespace URI (as defined in the W3C Namespace specification) of the node
on which the reader is positioned.
Gets the depth of the current node in the XML document.
Gets a value indicating whether the current node has any attributes
Gets the number of attributes on the current node.
Retrieves the correctly mapped namespace from the namespace provided
The name of the namespace to retrieve the mapping of
The name of the mapped namespace.
Adds the namespace to the namespace map. The default is to map the namespace to itself.
The namespace is mapped to the value returned by the callback, if a callback exists and the
callback returns a subsuming namespace.
The name of the namespace to be mapped.
The name of the mapped namespace.
Used to determine whether a given namespace subsumes another namespace
The name of the namespace to be checked.
true if the namespace subsumes another namespace; false otherwise
Used to specify that a namespace subsumes another namespace
The name of the namespace to be added.
Used to determine whether a given namespace is known/supported
The name of the namespace to be checked.
true if the namespace is known/supported; false otherwise
Used to specify that a namespace is known or supported
The name of the namespace to be added.
Used to determine whether a given namespace should be ignored. A namespace should be ignored if:
EITHER
a) the namespace is not known/supported and has been marked Ignorable
OR
b) the namespace is the markup-compatibility namespace
The name of the prefix to be checked.
true if the namespace should be ignored; false otherwise
breaks up a space-delineated string into namespace/element pairs
the string to be parsed
The calling element, used in case of an error
the list of namespace/element pairs
converts a string of space-delineated prefixes into a list of namespaces
the string to be parsed
the list of namespace/element pairs
advances the reader to the next known namespace/attribute pair
true if a known namespace/attribute pair was found
Scans the current element for compatibility attributes. Pushes a new
scope onto the stack under the following conditions:
1) Ignorable or MustUnderstand attribute read
2) current element has not previously declared an Ignorable or
MustUnderstand attribute
However, if a last condition is not fulfilled, then the scope is popped off
before the function returns
3) current element is not empty
stores in _ignoredAttributeCount the number of attributes on the current element
that should be ignored, for the sake of improving perf in attribute-related
methods/properties
the depth of the Reader at the element currently being processed
pops a scope if the end of a compatibility region.
the depth of the Reader at the element currently being processed
pushes a new scope onto the stack with a depth passed as an arg.
PushScope does not push a scope if the top scope on the stack is not a lower depth.
the depth of the Reader at the element currently being processed
pops a scope off the top of the stack.
PopScope *always* pops, it does not check the depth before doing so
handles mc:AlternateContent element
a good way to think of AlternateContent blocks is as a switch/case
statement. The AlternateContent tag is like switch, Choice is like
case, and Fallback is like default.
the depth of the Reader at the element currently being processed
returns whether the Reader has more to be read
handles mc:Choice element
a good way to think of AlternateContent blocks is as a switch/case
statement. The AlternateContent tag is like switch, Choice is like
case, and Fallback is like default.
the depth of the Reader at the element currently being processed
returns whether the Reader has more to be read
handles mc:Fallback element
a good way to think of AlternateContent blocks is as a switch/case
statement. The AlternateContent tag is like switch, Choice is like
case, and Fallback is like default.
the depth of the Reader at the element currently being processed
returns whether the Reader has more to be read
handles mc:Ignorable="foo" attribute
Ignorable is used to indicate that the namespace the prefix is mapped to can
be ignored, i.e. when the namespace/element or namespace/attribute occurs it
is not returned by the reader.
handles mc:MustUnderstand="foo" attribute
MustUnderstand is used to indicate that the namespace the prefix is mapped to
cannot be handled, and if it is not understood an exception is thrown
handles mc:ProcessContent="foo:bar" attribute
ProcessContent is used to indicate that an ignorable namespace has some
elements that should be skipped, but contain child elements that should be processed.
The wildcard token ("foo:*") indicates that the children of any element in that
namespace should be processed.
handles mc:PreserveElements="foo:bar" attribute
functionality is supported, but not implemented
handles mc:PreserveAttributes="foo:bar" attribute
functionality is supported, but not implemented
helper method to generate an exception
CompatibilityScopes are used to handle markup-compatibility elements and attributes.
Each scope stores the "previous" or parent scope, its depth, and an associated XmlCompatibilityReader.
At a particular Reader depth, only one scope should be pushed.
ZipPackage is a specific implementation for the abstract Package
class, corresponding to the Zip file format.
This is a part of the Packaging Layer APIs.
This method is for custom implementation for the underlying file format
Adds a new item to the zip archive corresponding to the PackagePart in the package.
PartName
Content type of the part
Compression option for this part
If partUri parameter is null
If contentType parameter is null
If partUri parameter does not conform to the valid partUri syntax
If CompressionOption enumeration [compressionOption] does not have one of the valid values
This method is for custom implementation specific to the file format.
Returns the part after reading the actual physical bits. The method
returns a null to indicate that the part corresponding to the specified
Uri was not found in the container.
This method does not throw an exception if a part does not exist.
This method is for custom implementation specific to the file format.
Deletes the part corresponding to the uri specified. Deleting a part that does not
exists is not an error and so we do not throw an exception in that case.
If partUri parameter is null
If partUri parameter does not conform to the valid partUri syntax
This method is for custom implementation specific to the file format.
This is the method that knows how to get the actual parts from the underlying
zip archive.
Some or all of the parts may be interleaved. The Part object for an interleaved part encapsulates
the Uri of the proper part name and the ZipFileInfo of the initial piece.
This function does not go through the extra work of checking piece naming validity
throughout the package.
This means that interleaved parts without an initial piece will be silently ignored.
Other naming anomalies get caught at the Stream level when an I/O operation involves
an anomalous or missing piece.
This function reads directly from the underlying IO layer and is supposed to be called
just once in the lifetime of a package (at init time).
An array of ZipPackagePart.
This method is for custom implementation corresponding to the underlying zip file format.
Closes the underlying ZipArchive object for this container
True if called during Dispose, false if called during Finalize
Internal constructor that is called by the OpenOnFile static method.
File path to the container.
Container is opened in the specified mode if possible
Container is opened with the specified access if possible
Container is opened with the specified share if possible
Internal constructor that is called by the Open(Stream) static methods.
ExtensionComparer
The Extensions are stored in the Default Dictionary in their original form,
however they are compared in a normalized manner.
Equivalence for extensions in the content type stream, should follow
the same rules as extensions of partnames. Also, by the time this code is invoked,
we have already validated, that the extension is in the correct format as per the
part name rules.So we are simplifying the logic here to just convert the extensions
to Upper invariant form and then compare them.
This is a helper class that maintains the Content Types File related to
this ZipPackage.
Initialize the object without uploading any information from the package.
Complete initialization in read mode also involves calling ParseContentTypesFile
to deserialize content type information.
Find the content type stream, allowing for interleaving. Naming collisions
(as between an atomic and an interleaved part) will result in an exception being thrown.
Return null if no content type stream has been found.
The input array is lexicographically sorted
This class represents a Part within a Zip container.
This is a part of the Packaging Layer APIs.
This implementation is specific to the Zip file format.
Custom Implementation for the GetStream Method
Mode in which the stream should be opened
Access with which the stream should be opened
Stream Corresponding to this part
Constructs a ZipPackagePart for an atomic (i.e. non-interleaved) part.
This is called from the ZipPackage class as a result of GetPartCore,
GetPartsCore or CreatePartCore methods
Obtain the ZipFileInfo descriptor of an atomic part.
The FileFormatException class is thrown when an input file or a data stream that is supposed to conform
to a certain file format specification is malformed.
Creates a new instance of FileFormatException class.
This constructor initializes the Message property of the new instance to a system-supplied message that describes the error,
such as "An input file or a data stream does not conform to the expected file format specification."
This message takes into account the current system culture.
Creates a new instance of FileFormatException class.
This constructor initializes the Message property of the new instance with a specified error message.
The message that describes the error.
Creates a new instance of FileFormatException class.
This constructor initializes the Message property of the new instance with a specified error message.
The InnerException property is initialized using the innerException parameter.
The error message that explains the reason for the exception.
The exception that is the cause of the current exception.
Creates a new instance of FileFormatException class.
This constructor initializes the Message property of the new instance to a system-supplied message that describes the error and includes the file name,
such as "The file 'sourceUri' does not conform to the expected file format specification."
This message takes into account the current system culture.
The SourceUri property is initialized using the sourceUri parameter.
The Uri of a file that caused this error.
Creates a new instance of FileFormatException class.
This constructor initializes the Message property of the new instance using the message parameter.
The content of message is intended to be understood by humans.
The caller of this constructor is required to ensure that this string has been localized for the current system culture.
The SourceUri property is initialized using the sourceUri parameter.
The Uri of a file that caused this error.
The message that describes the error.
Creates a new instance of FileFormatException class.
This constructor initializes the Message property of the new instance to a system-supplied message that describes the error and includes the file name,
such as "The file 'sourceUri' does not conform to the expected file format specification."
This message takes into account the current system culture.
The SourceUri property is initialized using the sourceUri parameter.
The InnerException property is initialized using the innerException parameter.
The Uri of a file that caused this error.
The exception that is the cause of the current exception.
Creates a new instance of FileFormatException class.
This constructor initializes the Message property of the new instance using the message parameter.
The content of message is intended to be understood by humans.
The caller of this constructor is required to ensure that this string has been localized for the current system culture.
The SourceUri property is initialized using the sourceUri parameter.
The InnerException property is initialized using the innerException parameter.
The Uri of a file that caused this error.
The message that describes the error.
The exception that is the cause of the current exception.
Sets the SerializationInfo object with the file name and additional exception information.
The object that holds the serialized object data.
The contextual information about the source or destination.
Returns the name of a file that caused this exception. This property may be equal to an empty string
if obtaining the file path that caused the error was not possible.
The file name.
Critical : Calls critical Demand for path discovery
Safe : Path which could be leaked by an exception is already known to caller since it is supplied by the caller
Format error in package.
Cannot modify readonly container
Cannot retrieve parts of writeonly container
FileMode/FileAccess for Part.GetStream is not compatible with FileMode/FileAccess used to open the Package.
ContentType string cannot have leading/trailing Linear White Spaces [LWS - RFC 2616].
Unrecognized root element in Core Properties part.
CreateNew not supported
The target of the Core Properties relationship does not reference an existing part.
Default tag is not valid per the schema. Verify that attributes are correct.
More than one '{0}' property found.
'{0}' element must be empty.
Encoding format is not supported. Only UTF-8 and UTF-16 are supported.
Relationships tag expected at root level.
';' must be followed by parameter=value pair.
Semicolon separator is required between two valid parameter=value pairs.
Invalid file format.
Invalid file format.
PackagePart subclass must implement GetContentTypeCore method if passing a null value for the content type when PackagePart object is constructed.
A Linear White Space character is not valid.
Parameter value must be a valid token or a quoted string as per RFC 2616.
Parameter and value pair is not valid. Expected form is parameter=value.
Part URI is not valid per rules defined in the Open Packaging Conventions specification.
'{0}' property name is not valid in Core Properties part.
Relationship Type cannot contain only spaces or be empty.
A token is not valid. Refer to RFC 2616 for correct grammar of content types.
ContentType string is not valid. Expected format is type/subtype.
'{0}' attribute value is not valid.
Relationships XML elements cannot specify attribute '{0}'.
Package has more than one Core Properties relationship.
TargetMode for a Core Properties relationship must be 'Internal'.
Core Properties part: core property elements can contain only text data.
'{0}' ID conflicts with the ID of an existing relationship for the specified source.
PackageRelationship part URI syntax is not valid.
'{0}' ID is not a valid XSD ID.
GetContentTypeCore method cannot return null for the content type stream.
Returned stream for the part is null.
Package object was closed and disposed, so cannot carry out operations on this object or any stream opened on a part of this package.
Override tag is not valid per the schema. Verify that attributes are correct.
Part was deleted.
PackageRelationship with specified ID does not exist for the source part.
PackageRelationship with specified ID does not exist at the Package level.
Cannot access part because parent package was closed.
Cannot add part for the specified URI because it is already in the package.
Specified part does not exist in the package.
Cannot add part to the package. Part names cannot be derived from another part name by appending segments to it.
Part URI cannot contain a Fragment component.
Part URI is empty.
Part URI cannot end with a forward slash.
Part URI cannot start with two forward slashes.
Part URI must start with a forward slash.
Core Properties part: A property start-tag was expected.
Unexpected number of attributes is found on '{0}'.
Incorrect content type for PackageRelationship part.
PackageRelationship parts cannot have relationships to other parts.
PackageRelationship part URI is expected.
PackageRelationship part URI is not expected.
Relationships tag has extra attributes.
Relationship tag contains incorrect attribute.
PackageRelationship target must be relative URI if TargetMode is Internal.
PackageRelationship cannot target another PackageRelationship.
'{0}' tag requires a nonempty '{1}' attribute.
'{0}' tag requires attribute '{1}'.
Relationship tag requires attribute '{0}'.
Cannot access Stream object because it was closed or disposed.
Truncate not supported
Required Types tag not found.
Types tag has attributes not valid per the schema.
Content Types XML does not match schema.
Unknown xsi:type for DateTime on '{0}'.
Unrecognized namespace in Core Properties part.
Unrecognized tag found in Relationships XML.
Cannot get stream with FileMode.Create, FileMode.CreateNew, FileMode.Truncate, FileMode.Append when access is FileAccess.Read.
Cannot be an absolute URI.
The Core Properties relationship references a part that has an incorrect content type.
Choice cannot follow a Fallback.
AlternateContent must contain one or more Choice elements.
Choice is valid only in AlternateContent.
There is a cycle of XML compatibility definitions, such that namespace '{0}' overrides itself. This could be due to inconsistent XmlnsCompatibilityAttributes in different assemblies. Please change the definitions to eliminate this cycle.
Duplicate Preserve declaration for element {1} in namespace '{0}'.
Duplicate ProcessContent declaration for element '{1}' in namespace '{0}'.
Duplicate wildcard Preserve declaration for namespace '{0}'.
Duplicate wildcard ProcessContent declaration for namespace '{0}'.
Fallback is valid only in AlternateContent.
'{0}' element is not a valid child of AlternateContent. Only Choice and Fallback elements are valid children of an AlternateContent element.
'{0}' attribute is not valid for '{1}' element.
'{0}' format is not valid.
Cannot have both a specific and a wildcard Preserve declaration for namespace '{0}'.
Cannot have both a specific and a wildcard ProcessContent declaration for namespace '{0}'.
Requires attribute must contain a valid namespace prefix.
'{0}' attribute value is not a valid XML name.
AlternateContent must contain only one Fallback element.
MustUnderstand condition failed on namespace '{0}'
'{0}' namespace cannot preserve items; it must be declared Ignorable first.
'{0}' namespace cannot process content; it must be declared Ignorable first.
Choice must contain Requires attribute.
'{0}' prefix is not defined.
Unrecognized compatibility attribute '{0}'.
Unrecognized Compatibility element '{0}'.
Core Properties part: Text data of XSD type 'DateTime' was expected.
CreateNew is not a valid FileMode for a non-empty stream.
Archive file cannot be size 0.
Package URI obtained from the pack URI cannot contain a Fragment.
The '{0}' parameter must start with '#'.
URI must contain pack:// scheme.
Must have absolute URI.
File contains corrupted data.
Specifies that null is allowed as an input even if the corresponding type disallows it.
Specifies that null is disallowed as an input even if the corresponding type allows it.
Specifies that an output may be null even if the corresponding type disallows it.
Specifies that an output will not be null even if the corresponding type allows it. Specifies that an input argument was not null when the call returns.
Specifies that when a method returns , the parameter may be null even if the corresponding type disallows it.
Initializes the attribute with the specified return value condition.
The return value condition. If the method returns this value, the associated parameter may be null.
Gets the return value condition.
Specifies that when a method returns , the parameter will not be null even if the corresponding type allows it.
Initializes the attribute with the specified return value condition.
The return value condition. If the method returns this value, the associated parameter will not be null.
Gets the return value condition.
Specifies that the output will be non-null if the named parameter is non-null.
Initializes the attribute with the associated parameter name.
The associated parameter name. The output will be non-null if the argument to the parameter specified is non-null.
Gets the associated parameter name.
Applied to a method that will never return under any circumstance.
Specifies that the method will not return if the associated Boolean parameter is passed the specified value.
Initializes the attribute with the specified parameter value.
The condition parameter value. Code after the method will be considered unreachable by diagnostics if the argument to
the associated parameter matches this value.
Gets the condition parameter value.
Specifies that the method or property will ensure that the listed field and property members have not-null values.
Initializes the attribute with a field or property member.
The field or property member that is promised to be not-null.
Initializes the attribute with the list of field and property members.
The list of field and property members that are promised to be not-null.
Gets field or property member names.
Specifies that the method or property will ensure that the listed field and property members have not-null values when returning with the specified return value condition.
Initializes the attribute with the specified return value condition and a field or property member.
The return value condition. If the method returns this value, the associated parameter will not be null.
The field or property member that is promised to be not-null.
Initializes the attribute with the specified return value condition and list of field and property members.
The return value condition. If the method returns this value, the associated parameter will not be null.
The list of field and property members that are promised to be not-null.
Gets the return value condition.
Gets field or property member names.