According to the scope feature in interface, the Methods or Events can be inherited as Private, Override, or Published.
The Private methods and events are intended for use within the descendant component only. Methods and Events selected as Override or Published automatically appear in the descendant component.
Let us assume that a chosen ancestor component has a method M. The inheritance process requires an interface to be created.
The following options (values of MethodScope) that are available for the ancestor's method M in the interface.
- Private - The method M does not appear in the descendant's methods list (in the component inspector of the descendant component) and should be called only from the code of the descendant component. This option is suitable when we want to only use the component without publishing its methods to the user.
- Override - The method M appears in the descendant methods list (in the component inspector of the descendant component), but user can write his/her own code to change its function (and also call the original method M of the ancestor if it is reasonable).
- Published - The method M behaves like the native method of the descendant component. This approach does not mean any overhead; the method is generated as a macro calling the ancestor's method.
Figure 1. Methods inheritance 