다음을 통해 공유


SPMobileMessageSmsBuilder.EndTextMessage Method (Int32, Boolean, Int32)

Completes a text message building transaction.

Namespace:  Microsoft.SharePoint.MobileMessage
Assembly:  Microsoft.SharePoint (in Microsoft.SharePoint.dll)

Syntax

'Declaration
Public Function EndTextMessage ( _
    maxPagesPerChunk As Integer, _
    hasPageNo As Boolean, _
    maxPages As Integer _
) As Boolean
'Usage
Dim instance As SPMobileMessageSmsBuilder
Dim maxPagesPerChunk As Integer
Dim hasPageNo As Boolean
Dim maxPages As Integer
Dim returnValue As Boolean

returnValue = instance.EndTextMessage(maxPagesPerChunk, _
    hasPageNo, maxPages)
public bool EndTextMessage(
    int maxPagesPerChunk,
    bool hasPageNo,
    int maxPages
)

Parameters

  • maxPagesPerChunk
    Type: System.Int32

    The maximum number of pages into which a chunk of text may be split. For more information, see AddChunk(String).

  • hasPageNo
    Type: System.Boolean

    true to indicate that page numbers are being added when a chunk is split into multiple pages; otherwise, false.

  • maxPages
    Type: System.Int32

    The maximum number of pages allowed in the whole message.

Return Value

Type: System.Boolean
true if all the intended text was included in the message; otherwise, false.

Exceptions

Exception Condition
SPException

The object returned by the Message property is not an SPMobileMessageSmsBuilder object.

Remarks

A call of one of the overloads of EndTextMessage() is the final part of a text message building transaction. The transaction begins with a call of StartTextMessage(). One or more calls of AddChunk(String) constitute the middle part of the transaction.

The method will attempt to create a SPMobileMessageContentPart from each chunk created by a call of AddChunk(String) in the middle part of the transaction. Since each content part becomes a child SMS message, it must not exceed the character limit imposed by the messaging service. Chunks that exceed the limit will be split into multiple content parts.

Every SPMobileMessageContentPart object that is created is added to ContentParts. Each of these will become a page of the parent message on the mobile device. However, if any chunk is so large that it cannot be split into fewer than maxPagesPerChunk+1 pages, the excess text in the chunk is discarded and not sent. Moreover, if the maxPages limit is reached or the number of content parts reaches the limit imposed by the service provider, no further content parts are made and the remainder of the chunks are discarded and not sent. If any chunk is not made into a content part, or any text of a chunk is not included in any content part, the method returns false.

See Also

Reference

SPMobileMessageSmsBuilder Class

SPMobileMessageSmsBuilder Members

EndTextMessage Overload

Microsoft.SharePoint.MobileMessage Namespace