Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Alex Gill 26 posts 61 karma points
    Sep 30, 2014 @ 10:55
    Alex Gill
    0

    Actions: legacy?

    I am following this tutorial on how to create a custom section, and have got to the implementation of GetMenuForNode().

    The author demonstrates implementing the menu using an IAction implementation.

    However, MenuItem has several different constructors. The one that accepts an IAction names that parameter "legacyMenu":

    public MenuItem(IAction legacyMenu, string name = "")
      : this()
    {
      this.Name = StringExtensions.IsNullOrWhiteSpace(name) ? legacyMenu.Alias : name;
      this.Alias = legacyMenu.Alias;
      this.SeperatorBefore = false;
      this.Icon = legacyMenu.Icon;
      this.Action = legacyMenu;
    }
    

    The word "legacy" set alarm bells off in my head - is this approach to constructing a MenuItem now obsolete? What is the alternative?

Please Sign in or register to post replies

Write your reply to:

Draft