You are developing a custom event handler to automatically print all open documents.

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 ref class PrintingArgs {
    public :
    int Copies;
    PrintingArgs (int numberOfCopies) {
    this->Copies = numberOfCopies;
    }};
B. public ref class PrintingArgs : public EventArgs {
    public : 
    int Copies;
    PrintingArgs(int numberOfCopies) {
    this->Copies = numberOfCopies;
    }};
C. public ref class PrintingArgs {
    public :
    EventArgs Args;
    PrintingArgs(EventArgs ea) {
    this->Args = ea;
    }};
D. public ref class PrintingArgs : public EventArgs {
    public :
    int Copies;};


Answer: B
 


No comments:

Post a Comment