Paint.NET Learning Notes--three, form (next)

Source: Internet
Author: User

Nearly 1 months has not updated, can not be lazy, continue to update PDN Learning notes! This section describes the inheritance relationships of forms in PDN, the implementation process, and so on.

As shown in the figure above, in PDN, all forms inherit from the Pdnbaseform class, which inherits from the form class and the Isnapmanagerhost interface, which defines the Snapmanager get method, Snapmanager is the admin interface window "Glue" effect, the implementation method is described later in the article.

Now take a quick look at the roles and features of each form.

BaseForm:

The base class of all PDN forms, mainly provides the common form method and registers, unloads the hot key.

1, Registerformhotkey (keys,function<bool,keys>): Registration Hotkey

PDN has the ability to set, process, and uninstall hotkeys, which facilitates the development of filter developers. In the Registerformhotkey method parameter, there is a function<bool,keys>. This parameter is a generic delegate, which has three types, indicating that the method that implements the delegate can have several overloaded forms. Also, an instance of the delegate must implement the IComponent and Ihotkeytarget interfaces, that is, the delegate must be issued by a form. In BaseForm, Hotkeyregistrar is a hotkey registration dictionary that holds all registered keys and delegates. The next thing is simple, rewrite the processCmdKey method, handle the keyboard event of the form, and find the delegate that corresponds to the key from the dictionary to execute.

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.