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.