Telerik® JustMock™ by Progress

Raises the specified event. If the event is not mocked and is declared on a C# or VB class and has the default implementation for add/remove, then that event can also be raised using this method, even with the profiler off.

Namespace: Telerik.JustMock.Helpers
Assembly: Telerik.JustMock (in Telerik.JustMock.dll) Version: 2013.3.1021.0 (2013.3.1021.0)


public static void Raise<T>(
	this T obj,
	Action<T> eventExpression,
	EventArgs args
Visual Basic
<ExtensionAttribute> _
Public Shared Sub Raise(Of T) ( _
	obj As T, _
	eventExpression As Action(Of T), _
	args As EventArgs _


Type: T
Target instance.
Type: System..::..Action<(Of <(<'T>)>)>
Event expression.
Type: System..::..EventArgs
EventArgs argument.

Type Parameters

Type of the object.

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type . When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).


Use this method for raising events based on EventHandler. The instance given in the event expression is used as an argument for the 'sender' parameter.

See Also