.NET Event Guidelines
C# allows you to write any type of event you desire. However, for component compatibility
with the .NET Framework, you will need to follow the guidelines Microsoft has established
for this purpose. At the core of these guidelines is the requirement that event handlers have
two parameters. The first is a reference to the object that generated the event. The second is
a parameter of type
EventArgs
that contains any other information required by the handler.
Thus, .NET-compatible event handlers will have this general form:
void
handler
(object
source
, EventArgs
arg
) {
// ...
}
Typically, the
source
parameter is passed
Do'stlaringiz bilan baham: |