IMessage.Properties プロパティ
メッセージのプロパティのコレクションを表す IDictionary を取得します。
ReadOnly Property Properties As IDictionary
[C#]
IDictionary Properties {get;}
[C++]
__property IDictionary* get_Properties();
[JScript]
function get Properties() : IDictionary;
プロパティ値
メッセージのプロパティのコレクションを表すディクショナリ。
例外
例外の種類 | 条件 |
---|---|
SecurityException | 直前の呼び出し元は、インターフェイスへの参照を通じて呼び出しを実行します。この呼び出し元には、インフラストラクチャ アクセス許可がありません。 |
使用例
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"))
[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"]);
[C++]
Console::WriteLine(S"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(S"{0} : {1}", myKeyName, myEnum->Value);
if (myKeyName->Equals(S"__Args"))
{
Object* myArgs[] = (Object*[])myValue;
for (int myInt = 0; myInt < myArgs->Length; myInt++)
Console::WriteLine(S"arg: {0} myValue: {1}", __box(myInt), myArgs[myInt]);
}
if ((myKeyName->Equals(S"__MethodSignature")) && (0 != myValue))
{
Object* myArgs[] = (Object*[])myValue;
for (int myInt = 0; myInt < myArgs->Length; myInt++)
Console::WriteLine(S"arg: {0} myValue: {1}", __box(myInt), myArgs[myInt]);
}
}
Console::WriteLine(S"myUrl1 {0} object URI{1}",myUrl,myObjectURI);
myDictionary->Item[S"__Uri"] = myUrl;
Console::WriteLine(S"URI {0}", myDictionary->Item[S"__URI"]);
[JScript] JScript のサンプルはありません。Visual Basic、C#、および C++ のサンプルを表示するには、このページの左上隅にある言語のフィルタ ボタン をクリックします。
必要条件
プラットフォーム: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 ファミリ
.NET Framework セキュリティ:
- SecurityPermission (インフラストラクチャ コードを操作するために必要なアクセス許可)要求値: SecurityAction.LinkDemand; アクセス許可値: SecurityPermissionFlag.Infrastructure
参照
IMessage インターフェイス | IMessage メンバ | System.Runtime.Remoting.Messaging 名前空間