WebBaseEventCollectionとは? わかりやすく解説

WebBaseEventCollection クラス

メモ : このクラスは、.NET Framework version 2.0 で新しく追加されたものです。

WebBaseEvent オブジェクトのコレクションを格納します。このクラスは継承できません。

名前空間: System.Web.Management
アセンブリ: System.Web (system.web.dll 内)
構文構文

Public NotInheritable Class
 WebBaseEventCollection
    Inherits ReadOnlyCollectionBase
Dim instance As WebBaseEventCollection
public sealed class WebBaseEventCollection
 : ReadOnlyCollectionBase
public ref class WebBaseEventCollection sealed
 : public ReadOnlyCollectionBase
public final class WebBaseEventCollection extends
 ReadOnlyCollectionBase
public final class WebBaseEventCollection extends
 ReadOnlyCollectionBase
解説解説
使用例使用例

WebBaseEventCollection クラスを使用するコード例を次に示します。

Imports System
Imports System.Text
Imports System.Web
Imports System.Web.Management
Imports System.Collections


' Implements a custom WebBaseEvent class. 
' Everytime this class is instantiated a WebBaseEvent is 
' created. This event object is then added to the static 
' simulatedEvents array list.

Public Class SampleWebBaseEventCollection
    Inherits System.Web.Management.WebBaseEvent
    Private customCreatedMsg As String
    
    Private Shared simulatedEvents As
 New ArrayList()
    Private Shared events _
    As System.Web.Management.WebBaseEventCollection
    
    
    ' Create a new WebBaseEvent and add it to the 
    ' static array list simulatedEvents.
    Public Sub New(ByVal
 msg As String, ByVal eventSource
 As Object, _
    ByVal eventCode As Integer)
        MyBase.New(msg, eventSource, eventCode)

        customCreatedMsg = String.Format("Event
 created at: {0}", _
        DateTime.Now.TimeOfDay.ToString())

        simulatedEvents.Add(Me)

    End Sub 'New
     
    
    ' Get the event with the specified index.
    Public Shared Function
 GetItem(ByVal index _
    As Integer) As WebBaseEvent
        Return events(index)

    End Function 'GetItem
    
    ' Get the index of the specified event.
    Public Shared Function
 GetIndexOf(ByVal ev _
    As WebBaseEvent) As Integer
        Return events.IndexOf(ev)

    End Function 'GetIndexOf
    
    ' Chek if the specified event is in the collection.
    Public Shared Function
 ContainsEvent(ByVal ev _
    As WebBaseEvent) As Boolean
        Return events.Contains(ev)

    End Function 'ContainsEvent
    
    ' Create an event collection.
    ' Add to it the created simulatedEvents.
    Public Shared Sub AddEvents()
 
        events = _
        New System.Web.Management.WebBaseEventCollection(simulatedEvents)
    
    End Sub 'AddEvents
    
    
    ' Display the events contained in the collection.
    Public Overrides Sub
 FormatCustomEventDetails(ByVal formatter _
    As WebEventFormatter)
        MyBase.FormatCustomEventDetails(formatter)
        ' Add custom data.
        formatter.AppendLine("")

        formatter.IndentationLevel += 1
        formatter.AppendLine("**SampleWebBaseEventCollection Data
 Start **")
        Dim ev As WebBaseEvent
        For Each ev In events
            formatter.AppendLine(String.Format("Message:
   {0}", _
            ev.Message))
            formatter.AppendLine(String.Format("Source:
    {0}", _
            ev.EventSource.ToString()))
            formatter.AppendLine(String.Format("Code:
      {0}", _
            ev.EventCode.ToString()))
        Next ev

        formatter.AppendLine("**SampleWebBaseEventCollection Data
 End **")

        formatter.IndentationLevel -= 1

    End Sub 'FormatCustomEventDetails
 
End Class 'SampleWebBaseEventCollection

using System;
using System.Text;
using System.Web;
using System.Web.Management;
using System.Collections;

namespace SamplesAspNet
{
    // Implements a custom WebBaseEvent class. 
    // Everytime this class is instantiated a WebBaseEvent is 
    // created. This event object is then added to the static 
    // simulatedEvents array list.
    public class SampleWebBaseEventCollection
 : System.Web.Management.WebBaseEvent
    {
        private string customCreatedMsg;

        private static ArrayList simulatedEvents
 = new ArrayList();
        private static System.Web.Management.WebBaseEventCollection
 events;

        // Create a new WebBaseEvent and add it to the 
        // static array list simulatedEvents.
        public SampleWebBaseEventCollection(
        string msg, object eventSource, int
 eventCode):
        base(msg, eventSource, eventCode)
        {

            customCreatedMsg =
              string.Format("Event created at: {0}",
 
              DateTime.Now.TimeOfDay.ToString());

            simulatedEvents.Add(this);

        }

        // Get the event with the specified index.
        public static WebBaseEvent GetItem(int
 index)
        {
            return events[index];
        }

        // Get the index of the specified event.
        public static int
 GetIndexOf(WebBaseEvent ev)
        {
            return events.IndexOf(ev);
        }

        // Check if the specified event is in the collection.
        public static bool
 ContainsEvent(WebBaseEvent ev)
        {
            return events.Contains(ev);
        }


        // Create an event collection.
        // Add to it the created simulatedEvents.
        public static void
 AddEvents()
        {
            events = 
            new System.Web.Management.WebBaseEventCollection(
            simulatedEvents);
        }


        // Display the events contained in the collection.
        public override void FormatCustomEventDetails(WebEventFormatter
 formatter)
        {
            base.FormatCustomEventDetails(formatter);
            // Add custom data.
            formatter.AppendLine("");

            formatter.IndentationLevel += 1;
            formatter.AppendLine(
                "**SampleWebBaseEventCollection Data Start **");
            foreach (WebBaseEvent ev in events)
            {
                formatter.AppendLine(string.Format(
                    "Message:   {0}", ev.Message));
                formatter.AppendLine(string.Format(
                    "Source:    {0}", ev.EventSource.ToString()));
                formatter.AppendLine(string.Format(
                    "Code:      {0}", ev.EventCode.ToString()));
            }

            formatter.AppendLine(
                "**SampleWebBaseEventCollection Data End **");

            formatter.IndentationLevel -= 1;

        }

    }
}
継承階層継承階層
System.Object
   System.Collections.ReadOnlyCollectionBase
    System.Web.Management.WebBaseEventCollection
スレッド セーフスレッド セーフ
この型の public static (Visual Basic では Shared) メンバはすべて、スレッド セーフです。インスタンス メンバの場合は、スレッド セーフであるとは限りません。
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
WebBaseEventCollection メンバ
System.Web.Management 名前空間
SqlWebEventProvider クラス
その他の技術情報
healthMonitoring 要素 (ASP.NET 設定スキーマ)
ASP.NET の状態監視

WebBaseEventCollection コンストラクタ

メモ : このコンストラクタは、.NET Framework version 2.0 で新しく追加されたものです。

WebBaseEventCollection クラスの新しいインスタンスを初期化します。

名前空間: System.Web.Management
アセンブリ: System.Web (system.web.dll 内)
構文構文

Public Sub New ( _
    events As ICollection _
)
Dim events As ICollection

Dim instance As New WebBaseEventCollection(events)
public WebBaseEventCollection (
    ICollection events
)
public:
WebBaseEventCollection (
    ICollection^ events
)
public WebBaseEventCollection (
    ICollection events
)
public function WebBaseEventCollection (
    events : ICollection
)

パラメータ

events

WebBaseEvent オブジェクトのコレクション。

解説解説

WebBaseEventCollection コンストラクタを使用すると、WebBaseEventCollection クラスのインスタンスを作成して、WebBaseEvent オブジェクトのコレクションで初期化できます。

使用例使用例

このコンストラクタを使用するコードの例を次に示します。

' Create an event collection.
' Add to it the created simulatedEvents.
Public Shared Sub AddEvents()
 
    events = _
    New System.Web.Management.WebBaseEventCollection(simulatedEvents)

End Sub 'AddEvents


// Create an event collection.
// Add to it the created simulatedEvents.
public static void AddEvents()
{
    events = 
    new System.Web.Management.WebBaseEventCollection(
    simulatedEvents);
}

プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
WebBaseEventCollection クラス
WebBaseEventCollection メンバ
System.Web.Management 名前空間
WebBaseEvent クラス
その他の技術情報
healthMonitoring 要素 (ASP.NET 設定スキーマ)

WebBaseEventCollection プロパティ


パブリック プロパティパブリック プロパティ

( プロテクト プロパティ も参照)
  名前 説明
パブリック プロパティ Count  ReadOnlyCollectionBase インスタンスに格納されている要素の数を取得します。 ( ReadOnlyCollectionBase から継承されます。)
パブリック プロパティ Item 指定したインデックス位置にある WebBaseEvent オブジェクトを取得します。
プロテクト プロパティプロテクト プロパティ
  名前 説明
プロテクト プロパティ InnerList  ReadOnlyCollectionBase インスタンスに格納されている要素のリストを取得します。 ( ReadOnlyCollectionBase から継承されます。)
参照参照

関連項目

WebBaseEventCollection クラス
System.Web.Management 名前空間
SqlWebEventProvider クラス

その他の技術情報

healthMonitoring 要素 (ASP.NET 設定スキーマ)
ASP.NET の状態監視

WebBaseEventCollection メソッド


パブリック メソッドパブリック メソッド

プロテクト メソッドプロテクト メソッド
参照参照

関連項目

WebBaseEventCollection クラス
System.Web.Management 名前空間
SqlWebEventProvider クラス

その他の技術情報

healthMonitoring 要素 (ASP.NET 設定スキーマ)
ASP.NET の状態監視

WebBaseEventCollection メンバ

WebBaseEvent オブジェクトのコレクションを格納します。このクラスは継承できません。

WebBaseEventCollection データ型で公開されるメンバを以下の表に示します。


パブリック コンストラクタパブリック コンストラクタ
  名前 説明
パブリック メソッド WebBaseEventCollection WebBaseEventCollection クラスの新しいインスタンスを初期化します。
パブリック プロパティパブリック プロパティ
( プロテクト プロパティ も参照)
  名前 説明
パブリック プロパティ Count  ReadOnlyCollectionBase インスタンスに格納されている要素の数を取得します。(ReadOnlyCollectionBase から継承されます。)
パブリック プロパティ Item 指定したインデックス位置にある WebBaseEvent オブジェクトを取得します。
プロテクト プロパティプロテクト プロパティ
  名前 説明
プロテクト プロパティ InnerList  ReadOnlyCollectionBase インスタンスに格納されている要素のリストを取得します。(ReadOnlyCollectionBase から継承されます。)
パブリック メソッドパブリック メソッド
プロテクト メソッドプロテクト メソッド
参照参照

関連項目

WebBaseEventCollection クラス
System.Web.Management 名前空間
SqlWebEventProvider クラス

その他の技術情報

healthMonitoring 要素 (ASP.NET 設定スキーマ)
ASP.NET の状態監視



英和和英テキスト翻訳

英語⇒日本語日本語⇒英語

辞書ショートカット

すべての辞書の索引

「WebBaseEventCollection」の関連用語

WebBaseEventCollectionのお隣キーワード
検索ランキング

   

英語⇒日本語
日本語⇒英語
   



WebBaseEventCollectionのページの著作権

   
日本マイクロソフト株式会社日本マイクロソフト株式会社
© 2026 Microsoft.All rights reserved.

©2026 GRAS Group, Inc.RSS