CustomErrorCollection クラス
定義
重要
一部の情報は、リリース前に大きく変更される可能性があるプレリリースされた製品に関するものです。 Microsoft は、ここに記載されている情報について、明示または黙示を問わず、一切保証しません。
CustomError オブジェクトのコレクションを表します。 このクラスは継承できません。
public ref class CustomErrorCollection sealed : System::Configuration::ConfigurationElementCollection
[System.Configuration.ConfigurationCollection(typeof(System.Web.Configuration.CustomError), AddItemName="error", CollectionType=System.Configuration.ConfigurationElementCollectionType.BasicMap)]
public sealed class CustomErrorCollection : System.Configuration.ConfigurationElementCollection
[<System.Configuration.ConfigurationCollection(typeof(System.Web.Configuration.CustomError), AddItemName="error", CollectionType=System.Configuration.ConfigurationElementCollectionType.BasicMap)>]
type CustomErrorCollection = class
inherit ConfigurationElementCollection
Public NotInheritable Class CustomErrorCollection
Inherits ConfigurationElementCollection
- 継承
- 属性
例
この例では、error セクションのcustomErrors要素に対して宣言によって値を指定する方法を示します。CustomErrorCollection コレクションの要素としてアクセスすることもできます。
次の構成ファイルの例は、 error 要素に対して宣言によって値を指定する方法を示しています。
<customErrors mode="RemoteOnly"
defaultRedirect="customerror.htm">
<error statusCode="404" redirect="customerror404.htm"/>
</customErrors>
次のコード例は、 CustomErrorCollection クラスの使用方法を示しています。
// Get the Web application configuration.
System.Configuration.Configuration configuration =
WebConfigurationManager.OpenWebConfiguration(
"/aspnetTest");
// Get the section.
CustomErrorsSection customErrorsSection =
(CustomErrorsSection)configuration.GetSection(
"system.web/customErrors");
// Get the collection
CustomErrorCollection customErrorsCollection =
customErrorsSection.Errors;
' Get the Web application configuration.
Dim configuration _
As System.Configuration.Configuration = _
WebConfigurationManager.OpenWebConfiguration( _
"/aspnetTest")
' Get the section.
Dim customErrorsSection _
As CustomErrorsSection = _
CType(configuration.GetSection( _
"system.web/customErrors"), _
CustomErrorsSection)
' Get the collection
Dim customErrorsCollection _
As CustomErrorCollection = customErrorsSection.Errors
注釈
CustomErrorCollection型を使用すると、error セクション要素コレクションのcustomErrors要素にアクセスできます。
これは、 CustomError、 CustomErrorsMode、および CustomErrorsSectionを含むグループに属しています。
コンストラクター
| 名前 | 説明 |
|---|---|
| CustomErrorCollection() |
CustomErrorCollection クラスの新しいインスタンスを初期化します。 |
プロパティ
メソッド
明示的なインターフェイスの実装
| 名前 | 説明 |
|---|---|
| ICollection.CopyTo(Array, Int32) |
ConfigurationElementCollection を配列にコピーします。 (継承元 ConfigurationElementCollection) |
拡張メソッド
| 名前 | 説明 |
|---|---|
| AsParallel(IEnumerable) |
クエリの並列化を有効にします。 |
| AsQueryable(IEnumerable) |
IEnumerable を IQueryableに変換します。 |
| Cast<TResult>(IEnumerable) |
IEnumerable の要素を指定した型にキャストします。 |
| OfType<TResult>(IEnumerable) |
指定した型に基づいて、IEnumerable の要素をフィルター処理します。 |