SPMobileMessageContentPart Constructor (String, String, String, Stream)
Initializes a new instance of the SPMobileMessageContentPart class that has the specified MIME type, ID, location, and content.
Namespace: Microsoft.SharePoint.MobileMessage
Assembly: Microsoft.SharePoint (in Microsoft.SharePoint.dll)
Syntax
'Declaration
Public Sub New ( _
mimeType As String, _
id As String, _
location As String, _
contentStream As Stream _
)
'Usage
Dim mimeType As String
Dim id As String
Dim location As String
Dim contentStream As Stream
Dim instance As New SPMobileMessageContentPart(mimeType, _
id, location, contentStream)
public SPMobileMessageContentPart(
string mimeType,
string id,
string location,
Stream contentStream
)
Parameters
mimeType
Type: System.StringThe MIME type of the content, such as “text/plain”.
id
Type: System.StringThe ID of the content part. See Remarks for its structure.
location
Type: System.StringThe filename of the content, not including the file extension. This parameter is not used in SharePoint Foundation, but it cannot be an empty string or a null reference (Nothing in Visual Basic). Pass any string.
contentStream
Type: System.IO.StreamThe content of the content part as binary data.
Exceptions
Exception | Condition |
---|---|
ArgumentException | One of the parameters is empty or a null reference (Nothing in Visual Basic). |
Remarks
In SharePoint Foundation, mimeType must be “text/plain”.
id has the following structure:
Attserial_number[.file_extension]@ GUID_with_no_spaces_or_punctuation
The file extension is optional. serial_number is zero for the first content part in a given message. Each subsequent content part added gets a serial number that is one greater than its predecessor. The following is an example content part ID:
Att2.txt@f024b9c54a0742bc909f6bf5beff106c
contentStream is converted to a string and stored in Content.
See Also
Reference
SPMobileMessageContentPart Class
SPMobileMessageContentPart Members