更新 : 2007 年 11 月
名前空間 :
System.ServiceModel.Description
アセンブリ :
System.ServiceModel (System.ServiceModel.dll 内)
Public ReadOnly Property Behaviors As KeyedByTypeCollection(Of IServiceBehavior)
Dim instance As ServiceDescription
Dim value As KeyedByTypeCollection(Of IServiceBehavior)
value = instance.Behaviors
public KeyedByTypeCollection<IServiceBehavior> Behaviors { get; }
public:
property KeyedByTypeCollection<IServiceBehavior^>^ Behaviors {
KeyedByTypeCollection<IServiceBehavior^>^ get ();
}
/** @property */
public KeyedByTypeCollection<IServiceBehavior> get_Behaviors()
public function get Behaviors () : KeyedByTypeCollection<IServiceBehavior>
カスタム動作を追加するときにこのメソッドを使用して、ServiceHost を拡張します。プログラムにより、ServiceHost オブジェクトで Open メソッドを呼び出すより前に、Add(T) を実行して、カスタム サービス動作を Behaviors に追加する必要があります。
説明階層からアクセスできる動作の型は、特定のレベルに限定されます。ServiceDescription から、IServiceBehavior にアクセスできます。
代わりに、エンドポイントに関連付けられた IEndpointBehavior にアクセスする場合は、Endpoints プロパティを使用してサービスのエンドポイントを取得します。次に、関連する検索基準を使用して Find メソッドを実行することによってコレクションから ServiceEndpoint を取得し、Behaviors プロパティを呼び出して IEndpointBehavior オブジェクトのコレクションを取得します。
//// Iterate through the list of behaviors in the ServiceDescription
//ServiceDescription svcDesc = serviceHost.Description;
//KeyedByTypeCollection<IServiceBehavior> sbCol = svcDesc.Behaviors;
//foreach (IServiceBehavior behavior in sbCol)
//{
// Console.WriteLine("Behavior: {0}", behavior.ToString());
//}
- 直前の呼び出し元に対する完全な信頼。このメンバは、部分的に信頼されているコードから使用することはできません。詳細については、「部分信頼コードからのライブラリの使用」を参照してください。
Windows Vista, Windows XP SP2, Windows Server 2003
.NET Framework および .NET Compact Framework では、各プラットフォームのすべてのバージョンはサポートしていません。サポートされているバージョンについては、「.NET Framework システム要件」を参照してください。
.NET Framework
サポート対象 : 3.5、3.0
参照