Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
PartExists Method

Package.PartExists Method

Determines whether a part with a given URI is in the package.

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

public virtual bool PartExists (
	Uri partUri
)
public boolean PartExists (
	Uri partUri
)
public function PartExists (
	partUri : Uri
) : boolean
You cannot use methods in XAML.

Parameters

partUri

The Uri of the part to check for.

Return Value

true if a part with the specified partUri is in the package; otherwise, false.

Exception typeCondition

ArgumentNullException

partUri is a null reference (Nothing in Visual Basic).

ArgumentException

partUri is not a valid PackagePart uniform resource identifier (URI).

ObjectDisposedException

The package is not open (Dispose or Close has been called).

IOException

The package is write-only (information cannot be read).

The partUri should begin with a forward-slash character "/" and be absolute from the root of the package.

For additional information see the Open Packaging Conventions (OPC) specification available for download at http://go.microsoft.com/fwlink/?LinkID=71255.

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

Community Additions

ADD
Show:
© 2015 Microsoft