You create a Microsoft ASP.NET application by using the Microsoft .NET Framework version 3.5.
You create a custom control named OrderForm.
You write the following code segment.
Public Delegate Sub CheckOrderFormEventHandler(e As EventArgs)
Private Shared ReadOnly CheckOrderFormKey As New Object()
Public Custom Event CheckOrderForm As CheckOrderFormEventHandler
AddHandler(ByVal value As CheckOrderFormEventHandler)
Events.[AddHandler](CheckOrderFormKey, value)
End AddHandler
RemoveHandler(ByVal value As CheckOrderFormEventHandler)
Events.[RemoveHandler](CheckOrderFormKey, value)
End RemoveHandler
End Event
You need to provide a method that enables the OrderForm control to raise the CheckOrderForm event.
Which code segment should you use?
A.
Protected Overridable Sub OnCheckOrderForm(e As EventArgs)
Dim checkOrderForm As CheckOrderFormEventHandler = DirectCast(Events(GetType(CheckOrderFormEventHandler)), CheckOrderFormEventHandler)
RaiseEvent checkOrderForm(e)
End Sub
B.
Protected Overridable Sub OnCheckOrderForm(e As EventArgs)
Dim checkOrderForm As CheckOrderFormEventHandler = TryCast(Events(CheckOrderFormKey), CheckOrderFormEventHandler)
RaiseEvent checkOrderForm(e)
End Sub
C.
Private checkOrderForm As New CheckOrderFormEventHandler(checkOrderFormCallBack)
Protected Overridable Sub OnCheckOrderForm(e As EventArgs)
RaiseEvent checkOrderForm(e)
End Sub
D.
Private checkOrderForm As New CheckOrderFormEventHandler(checkOrderFormCallBack)
Protected Overridable Sub OnCheckOrderForm(e As EventArgs)
If checkOrderForm IsNot Nothing Then
RaiseBubbleEvent(checkOrderForm, e)
End If
End Sub