IMessage.Properties Property
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.
Gets an IDictionary that represents a collection of the message's properties.
public:
property System::Collections::IDictionary ^ Properties { System::Collections::IDictionary ^ get(); };
C#
public System.Collections.IDictionary Properties { get; }
C#
public System.Collections.IDictionary Properties { [System.Security.SecurityCritical] get; }
member this.Properties : System.Collections.IDictionary
[<get: System.Security.SecurityCritical>]
member this.Properties : System.Collections.IDictionary
Public ReadOnly Property Properties As IDictionary
A dictionary that represents a collection of the message's properties.
- Attributes
The immediate caller makes the call through a reference to the interface and does not have infrastructure permission.
Console::WriteLine( "Message Properties" );
IDictionary^ myDictionary = myMesg->Properties;
IDictionaryEnumerator^ myEnum = dynamic_cast<IDictionaryEnumerator^>(myDictionary->GetEnumerator());
while ( myEnum->MoveNext() )
{
Object^ myKey = myEnum->Key;
String^ myKeyName = myKey->ToString();
Object^ myValue = myEnum->Value;
Console::WriteLine( "{0} : {1}", myKeyName, myEnum->Value );
if ( myKeyName->Equals( "__Args" ) )
{
array<Object^>^myArgs = (array<Object^>^)myValue;
for ( int myInt = 0; myInt < myArgs->Length; myInt++ )
Console::WriteLine( "arg: {0} myValue: {1}", myInt, myArgs[ myInt ] );
}
if ( (myKeyName->Equals( "__MethodSignature" )) && (nullptr != myValue) )
{
array<Object^>^myArgs = (array<Object^>^)myValue;
for ( int myInt = 0; myInt < myArgs->Length; myInt++ )
Console::WriteLine( "arg: {0} myValue: {1}", myInt, myArgs[ myInt ] );
}
}
Console::WriteLine( "myUrl1 {0} object URI{1}", myUrl, myObjectURI );
myDictionary->default[ "__Uri" ] = myUrl;
Console::WriteLine( "URI {0}", myDictionary->default[ "__URI" ] );
C#
Console.WriteLine("Message Properties");
IDictionary myDictionary = myMesg.Properties;
IDictionaryEnumerator myEnum = (IDictionaryEnumerator) myDictionary.GetEnumerator();
while (myEnum.MoveNext())
{
object myKey = myEnum.Key;
string myKeyName = myKey.ToString();
object myValue = myEnum.Value;
Console.WriteLine("{0} : {1}", myKeyName, myEnum.Value);
if (myKeyName == "__Args")
{
object[] myArgs = (object[])myValue;
for (int myInt = 0; myInt < myArgs.Length; myInt++)
Console.WriteLine("arg: {0} myValue: {1}", myInt, myArgs[myInt]);
}
if ((myKeyName == "__MethodSignature") && (null != myValue))
{
object[] myArgs = (object[])myValue;
for (int myInt = 0; myInt < myArgs.Length; myInt++)
Console.WriteLine("arg: {0} myValue: {1}", myInt, myArgs[myInt]);
}
}
Console.WriteLine("myUrl1 {0} object URI{1}",myUrl,myObjectURI);
myDictionary["__Uri"] = myUrl;
Console.WriteLine("URI {0}", myDictionary["__URI"]);
Console.WriteLine("Message Properties")
Dim myDictionary As IDictionary = myMesg.Properties
Dim myEnum As IDictionaryEnumerator = CType(myDictionary.GetEnumerator(), IDictionaryEnumerator)
While myEnum.MoveNext()
Dim myKey As Object = myEnum.Key
Dim myKeyName As String = myKey.ToString()
Dim myValue As Object = myEnum.Value
Console.WriteLine( "{0} : {1}", myKeyName, myEnum.Value)
If myKeyName = "__Args" Then
Dim myArgs As Object() = CType(myValue, Object())
Dim myInt As Integer
For myInt = 0 To myArgs.Length - 1
Console.WriteLine( "arg: {0} myValue: {1}", myInt, myArgs(myInt))
Next myInt
End If
If myKeyName = "__MethodSignature" And Not (myValue Is Nothing) Then
Dim myArgs As Object() = CType(myValue, Object())
Dim myInt As Integer
For myInt = 0 To myArgs.Length - 1
Console.WriteLine("arg: {0} myValue: {1}", myInt, myArgs(myInt))
Next myInt
End If
End While
Console.WriteLine("myUrl1 {0} object URI{1}", myUrl, myObjectURI)
myDictionary("__Uri") = myUrl
Console.WriteLine("URI {0}", myDictionary("__URI"))
Продукт | Версии |
---|---|
.NET Framework | 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1 |
Работете съвместно с нас в GitHub
Източникът за това съдържание може да бъде намерен в GitHub, където можете също да създавате и преглеждате проблеми и да изтегляте искания. За повече информация вижте нашето ръководство за сътрудник.
Обратна връзка за .NET
.NET е проект с отворен код. Изберете връзка, за да предоставите обратна връзка: