You are developing a custom event handler to automatically print all open documents. The event handler helps specify the number of copies to be printed. You need to develop a custom event arguments class to pass as a parameter to the event handler. Which code segment should you use?

You are developing a custom event handler to automatically print all open documents.
The event handler helps specify the number of copies to be printed. You need to develop a
custom event arguments class to pass as a parameter to the event handler.
Which code segment should you use?

A. Public Class PrintingArgs     Private _copies As Integer
    Public Sub New(ByVal numberOfCopies As Integer)
    Me._copies = numberOfCopies
    End Sub
    Public ReadOnly Property Copies() As Integer
    Get
    Return Me._copies
    End Get
    End PropertyEnd Class
B. Public Class PrintingArgs
    Inherits EventArgs
    Private _copies As Integer
    Public Sub New(ByVal numberOfCopies As Integer)
    Me._copies = numberOfCopies
    End Sub
    Public ReadOnly Property Copies() As Integer
    Get
    Return Me._copies
    End Get
    End PropertyEnd Class
C. Public Class PrintingArgs
    Private eventArgs As EventArgs
    Public Sub New(ByVal args As EventArgs)
    Me.eventArgs = args
    End Sub
    Public ReadOnly Property Args() As EventArgs
    Get
    Return eventArgs
    End Get
    End PropertyEnd Class
D. Public Class PrintingArgs
    Inherits EventArgs
    Private copies As IntegerEnd Class

Answer: B

No comments:

Post a Comment