WebBaseEventCollection Class
Contains a collection of WebBaseEvent objects. This class cannot be inherited.
Assembly: System.Web (in System.Web.dll)
System.Collections.ReadOnlyCollectionBase
System.Web.Management.WebBaseEventCollection
| Name | Description | |
|---|---|---|
![]() | WebBaseEventCollection(ICollection) | Initializes a new instance of the WebBaseEventCollection class. |
| Name | Description | |
|---|---|---|
![]() | Count | Gets the number of elements contained in the ReadOnlyCollectionBase instance.(Inherited from ReadOnlyCollectionBase.) |
![]() | Item(Int32) | Gets the WebBaseEvent object at the specified index. |
| Name | Description | |
|---|---|---|
![]() | Contains(WebBaseEvent) | Indicates whether the collection contains the specified WebBaseEvent object. |
![]() | Equals(Object) | Determines whether the specified object is equal to the current object.(Inherited from Object.) |
![]() | GetEnumerator() | Returns an enumerator that iterates through the ReadOnlyCollectionBase instance.(Inherited from ReadOnlyCollectionBase.) |
![]() | GetHashCode() | Serves as the default hash function. (Inherited from Object.) |
![]() | GetType() | |
![]() | IndexOf(WebBaseEvent) | Gets the index of the specified WebBaseEvent object. |
![]() | ToString() | Returns a string that represents the current object.(Inherited from Object.) |
| Name | Description | |
|---|---|---|
![]() ![]() | ICollection.CopyTo(Array, Int32) | Copies the entire ReadOnlyCollectionBase to a compatible one-dimensional Array, starting at the specified index of the target array.(Inherited from ReadOnlyCollectionBase.) |
![]() ![]() | ICollection.IsSynchronized | Gets a value indicating whether access to a ReadOnlyCollectionBase object is synchronized (thread safe).(Inherited from ReadOnlyCollectionBase.) |
![]() ![]() | ICollection.SyncRoot | Gets an object that can be used to synchronize access to a ReadOnlyCollectionBase object.(Inherited from ReadOnlyCollectionBase.) |
| Name | Description | |
|---|---|---|
![]() | AsParallel() | Overloaded. Enables parallelization of a query.(Defined by ParallelEnumerable.) |
![]() | AsQueryable() | Overloaded. Converts an IEnumerable to an IQueryable.(Defined by Queryable.) |
![]() | Cast(Of TResult)() | Casts the elements of an IEnumerable to the specified type.(Defined by Enumerable.) |
![]() | OfType(Of TResult)() | Filters the elements of an IEnumerable based on a specified type.(Defined by Enumerable.) |
ASP.NET health monitoring allows production and operations staff to manage deployed Web applications. The System.Web.Management namespace contains the health event types responsible for packaging application health-status data and the provider types responsible for processing this data. It also contains supporting types that help during the management of health events.
The WebBaseEventCollection class is used to deliver a collection of health-monitoring events to providers such as the SqlWebEventProvider.
The following code example shows how to use the WebBaseEventCollection class.
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 'NewNew ' 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
Available since 2.0
Any public static ( Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
.jpeg?cs-save-lang=1&cs-lang=vb)
.jpeg?cs-save-lang=1&cs-lang=vb)
.jpeg?cs-save-lang=1&cs-lang=vb)
.jpeg?cs-save-lang=1&cs-lang=vb)
.jpeg?cs-save-lang=1&cs-lang=vb)