Message.Parts 屬性
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
取得包含於 MessagePart 中的 Message 物件的集合。
public:
property System::Web::Services::Description::MessagePartCollection ^ Parts { System::Web::Services::Description::MessagePartCollection ^ get(); };
public System.Web.Services.Description.MessagePartCollection Parts { get; }
member this.Parts : System.Web.Services.Description.MessagePartCollection
Public ReadOnly Property Parts As MessagePartCollection
屬性值
範例
下列範例示範 屬性的 Parts 一般用法。
// Creates a Message with name = messageName having one MessagePart
// with name = partName.
public:
static Message^ CreateMessage( String^ messageName, String^ partName, String^ element, String^ targetNamespace )
{
Message^ myMessage = gcnew Message;
myMessage->Name = messageName;
MessagePart^ myMessagePart = gcnew MessagePart;
myMessagePart->Name = partName;
myMessagePart->Element = gcnew XmlQualifiedName( element,targetNamespace );
myMessage->Parts->Add( myMessagePart );
return myMessage;
}
// Creates a Message with name = messageName having one MessagePart
// with name = partName.
public static Message CreateMessage(string messageName,string partName,
string element,string targetNamespace)
{
Message myMessage = new Message();
myMessage.Name = messageName;
MessagePart myMessagePart = new MessagePart();
myMessagePart.Name = partName;
myMessagePart.Element = new XmlQualifiedName(element,targetNamespace);
myMessage.Parts.Add(myMessagePart);
return myMessage;
}
' Creates a Message with name = messageName having one MessagePart
' with name = partName.
Public Shared Function CreateMessage(messageName As String, _
partName As String, element As String, targetNamespace As String) _
As Message
Dim myMessage As New Message()
myMessage.Name = messageName
Dim myMessagePart As New MessagePart()
myMessagePart.Name = partName
myMessagePart.Element = New XmlQualifiedName(element, targetNamespace)
myMessage.Parts.Add(myMessagePart)
Return myMessage
End Function 'CreateMessage