C # event is empty

Source: Internet
Author: User

Principle:

1. If no event handler is written for the event, then the event (also a class, class object) is empty

2, the above mentioned

event = = Delegate (event handler)

This syntax-formatted statement simply associates the event with the event handler, and at this point the event handler is already defined, because the call to the event handler, which indicates which function to use when the event occurs, indicates that the This association is written in the event receiver (the general user code is in the event receiver, such as system events are issued by the system, the receiver is associated with a custom event handler to implement a variety of functional applications);

The event is raised on the event sender side and is typically implemented using the following code

if (EventObject!= null)

{

EventObject (sender, Ev);

}

When the event handler is defined, the eventobject is not null, at which point the event is raised with the EventObject (sender, EV) statement, which is equivalent to the SendMessage effect in C

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.