This documentation is archived and is not being maintained.

IVsaCodeItem.RemoveEventSource Method

Removes the specified event source from the code item.

[Visual Basic]
Sub RemoveEventSource( _
   ByVal eventSourceName As String _
void RemoveEventSource(
   string eventSourceName
void RemoveEventSource(
   String* eventSourceName
function RemoveEventSource(
   eventSourceName : String


The programmatic name of the event source to be removed.


Removing an event source does not remove the underlying event handler from source text. Rather, events no longer raise notifications to the event handler. Therefore, you will get a compiler error if you delete an event source but leave the underlying function in the source code.

The following table shows the exceptions that the RemoveEventSource method can throw.

Exception Type Condition
EngineClosed The IVsaEngine.Close method has been called and the engine is closed.
EngineBusy The engine is currently executing code for another thread.
EngineRunning The engine is running.
EventSourceNotFound The named event source is not currently in use by the item.


Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family

See Also

IVsaCodeItem Interface | IVsaCodeItem Members | Microsoft.Vsa Namespace