NGWS SDK Documentation  

This is preliminary documentation and subject to change.
To comment on this topic, please send us email at ngwssdk@microsoft.com. Thanks!

EventLog.AddOnEntryWritten

Adds an event handler for the System.Diagnostics.EventLog.EntryWritten event.

[Visual Basic]
Overridable Public Sub AddOnEntryWritten( _
   ByVal handler As EventLogEventHandler _
)
[C#]
public virtual void AddOnEntryWritten(
   EventLogEventHandler handler
);
[C++]
public: virtual void AddOnEntryWritten(
   EventLogEventHandler* handler
);
[JScript]
public function AddOnEntryWritten(
   handler : EventLogEventHandler
);

Parameters

handler
An EventLogEventHandler delegate that represents the method that will handle the System.Diagnostics.EventLog.EntryWritten event.

Exceptions

Exception Type Condition
ArgumentException The handler parameter is a null reference (Visual Basic Nothing). The handler might not have been initialized.
ArgumentException A value is not specified for the Log property. Make sure the log name is not an empty string.
SystemException The method cannot create a system event to notify the log to start monitoring for events.
Exception The log cannot be opened. No Windows error code is available.
Win32Exception The log cannot be opened. A Windows error code is available.

Remarks

This method causes the handler to start accepting events being posted to the active log.

See Also

EventLog Class | EventLog Members | System.Diagnostics Namespace