Question on 'AppendAdditionalMenuItems'

What is the difference between AppendAdditionalMenuItems and AppendAdditionalComponentMenuItems?

From the code:

        // Summary:
        //     Adds typical component type items to the context menu: 1. Data comparison types
        //     2. Custom (overridden) items 3. Nested input parameter context menu items 4.
        //     Nested output parameter context menu items
        //
        // Parameters:
        //   menu:
        public override void AppendAdditionalMenuItems(ToolStripDropDown menu);

and



        // Summary:
        //     Override this function if you want to insert some custom menu items in your derived
        //     Component class. Items will be added between List Matching items and parameter
        //     menus.
        protected virtual void AppendAdditionalComponentMenuItems(ToolStripDropDown menu);

What is the difference between the two method: AppendAdditionalMenuItems and AppendAdditionalComponentMenuItems?

Additionally, the first one is with override keyword but the second is virtual.

Hello,

You can only “replace” a “virtual” method.
A “virtual” method is declared in the master class.
An “override” method is in the class inherited from this class.

AppendAdditionalComponentMenuItems is call by AppendAdditionalMenuItems

1 Like

You can override all* base methods assigned the override and virtual/abstract modifiers, as the override method points to a virtual/abstract method in the base.base class.

*except if a method is marked sealed override. In that case your base method is overriding a virtual or abstract method from it’s own base, but it also tells that any inherited classes should not be able to modify it any more.