Export (0) Print
Expand All

PackagePart.GetContentTypeCore Method

When overridden in a derived class, returns the MIME type of the part content.

Namespace:  System.IO.Packaging
Assembly:  WindowsBase (in WindowsBase.dll)

protected virtual string GetContentTypeCore()

Return Value

Type: System.String
The MIME type of the part content.

ExceptionCondition
NotSupportedException

The derived class does not provide an override implementation required for the GetContentTypeCore method.

GetContentTypeCore is a virtual method of the PackagePart abstract base class. Implement this method only in derived types where the value for the content type cannot be provided at the time of construction, or if calculating the content type value is a nontrivial or costly operation. The return value must be a valid MIME content type.

Derived classes can call GetContentTypeCore to initialize the ContentType property of the derived class to a default value. After the ContentType property has been set it cannot be changed.

.NET Framework

Supported in: 4.5.2, 4.5.1, 4.5, 4, 3.5, 3.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Show:
© 2014 Microsoft