MimePartCollection.Remove Method

Removes the first occurrence of the specified MimePart from the MimePartCollection.

Namespace: System.Web.Services.Description
Assembly: System.Web.Services (in system.web.services.dll)

public:
void Remove (
	MimePart^ mimePart
)
public void Remove (
	MimePart mimePart
)
public function Remove (
	mimePart : MimePart
)
Not applicable.

Parameters

mimePart

The MimePart to remove from the collection.

This method performs a linear search; therefore, the average execution time is proportional to Count.

The elements that follow the removed MimePart move up to occupy the vacated spot.

The following example demonstrates a typical use of the Remove method.

Console::WriteLine( "Removing a mimepart object..." );

// Remove the mimepart from the mimepartcollection.
myMimePartCollection->Remove( myMimePart1 );

// Check whether the mimepart is removed or not.
if (  !myMimePartCollection->Contains( myMimePart1 ) )
   Console::WriteLine( "Mimepart is succesfully removed from mimepartcollection" );

Console.WriteLine("Removing a mimepart object...");

// Remove the mimepart from the mimepartcollection.
myMimePartCollection.Remove(myMimePart1);

// Check whether the mimepart is removed or not.
if (!(myMimePartCollection.Contains(myMimePart1))) {
    Console.WriteLine("Mimepart is succesfully removed "
        + "from mimepartcollection");
}

Windows 98, Windows Server 2000 SP4, Windows Millennium Edition, 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, 2.0, 1.1, 1.0

Community Additions

ADD
Show: