Question
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 shocould you use?
Translation:
You are developing to automatically print all custom events that open the documentProgram. The event provides the number of printed copies. You need to develop a Custom Event parameter class to pass parameters to the event. Which segment will you use?Code?
Analyze by yourself:
1Custom Event parameters must beEventargs
2, The number of printed copies must be passed
BAndDFirst selected. The number of copies is not assigned a value or a value. AllB
For an example, see C # custom events and use the Custom Event parameter method.
A: Public Class Printingargs
{
Private Int Copies;
Public Printingargs ( Int Numberofcopies)
{
This . Copies = Numberofcopies;
}
Public Int Copies
{
Get { Return This . Copies ;}
}
}
B:
Public Class Printingargs: eventargs
{
Private Int Copies;
Public Printingargs ( Int Numberofcopies)
{
This . Copies = Numberofcopies;
}
Public Int Copies
{
Get { Return This . Copies ;}
}
}
C:
Public Class Printingargs
{
Private Eventargs;
Public Printingargs (eventargs EA)
{
This . Eventargs = EA;
}
Public Eventargs ARGs
{
Get { Return Eventargs ;}
}
}
D:
Public Class Printingargs: eventargs
{
Private Int Copies;
}