Прочетете на английски Редактиране

Споделяне чрез


IMessage.Properties Property

Definition

Gets an IDictionary that represents a collection of the message's properties.

C#
public System.Collections.IDictionary Properties { get; }
C#
public System.Collections.IDictionary Properties { [System.Security.SecurityCritical] get; }

Property Value

A dictionary that represents a collection of the message's properties.

Attributes

Exceptions

The immediate caller makes the call through a reference to the interface and does not have infrastructure permission.

Examples

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"]);

Applies to

Продукт Версии
.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