MimePartCollection.Add(MimePart) Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Adds the specified MimePart to the end of the MimePartCollection.
public:
int Add(System::Web::Services::Description::MimePart ^ mimePart);
public int Add (System.Web.Services.Description.MimePart mimePart);
member this.Add : System.Web.Services.Description.MimePart -> int
Public Function Add (mimePart As MimePart) As Integer
Parameters
Returns
The zero-based index where the mimePart
parameter has been added.
Examples
The following example demonstrates a typical use of the Add
method.
MimePart^ myMimePart2 = gcnew MimePart;
MimeXmlBinding^ myMimeXmlBinding2 = gcnew MimeXmlBinding;
myMimeXmlBinding2->Part = "body";
myMimePart2->Extensions->Add( myMimeXmlBinding2 );
// Add a mimepart to the mimepartcollection.
myMimePartCollection->Add( myMimePart2 );
Console::WriteLine( "Adding a mimepart object..." );
// Check if collection contains added mimepart object.
if ( myMimePartCollection->Contains( myMimePart2 ) )
Console::WriteLine( "'MimePart' is successfully added at position: {0}", myMimePartCollection->IndexOf( myMimePart2 ) );
MimePart myMimePart2=new MimePart();
MimeXmlBinding myMimeXmlBinding2 = new MimeXmlBinding();
myMimeXmlBinding2.Part = "body";
myMimePart2.Extensions.Add(myMimeXmlBinding2);
// Add a mimepart to the mimepartcollection.
myMimePartCollection.Add(myMimePart2);
Console.WriteLine("Adding a mimepart object...");
// Check if collection contains added mimepart object.
if(myMimePartCollection.Contains(myMimePart2))
{
Console.WriteLine("'MimePart' is successfully added at position: "
+myMimePartCollection.IndexOf(myMimePart2));
}
Dim myMimePart2 As New MimePart()
Dim myMimeXmlBinding2 As New MimeXmlBinding()
myMimeXmlBinding2.Part = "body"
myMimePart2.Extensions.Add(myMimeXmlBinding2)
' Add a mimepart to the mimepartcollection.
myMimePartCollection.Add(myMimePart2)
Console.WriteLine("Adding a mimepart object...")
' Check if collection contains added mimepart object.
If myMimePartCollection.Contains(myMimePart2) Then
Console.WriteLine("'MimePart' is successfully added at position: " + _
myMimePartCollection.IndexOf(myMimePart2).ToString())
End If
Applies to
Samarbejd med os på GitHub
Kilden til dette indhold kan findes på GitHub, hvor du også kan oprette og gennemse problemer og pullanmodninger. Du kan få flere oplysninger i vores vejledning til bidragydere.