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 ()
protected String GetContentTypeCore ()
protected function GetContentTypeCore () : String
You cannot use methods in XAML.

Return Value

The MIME type of the part content.

Exception typeCondition


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.

Windows 98, Windows Server 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0