Esempio n. 1
0
        protected virtual Node <InterfaceMenuItem> GetNode(LinkPluginAttribute np)
        {
            var node = new Node <InterfaceMenuItem>(new InterfaceMenuItem
            {
                Title     = np.Title,
                Name      = np.Name,
                Target    = np.Target,
                ToolTip   = np.ToolTip,
                IconUrl   = string.IsNullOrEmpty(np.IconClass) ? Retoken(np.IconUrl) : null,
                Url       = Retoken(np.UrlFormat),
                IsDivider = np.IsDivider,
                IconClass = np.IconClass
            });

            if (np is ToolbarPluginAttribute)
            {
                var tp = np as ToolbarPluginAttribute;
                if (tp.OptionProvider != null)
                {
                    var options = (IProvider <ToolbarOption>)engine.Resolve(tp.OptionProvider);
                    node.Children = options.GetAll().Select(o => GetNode(o)).ToList();
                }
            }
            return(node);
        }
Esempio n. 2
0
 protected virtual Node <InterfaceMenuItem> CreateNode(LinkPluginAttribute np)
 {
     return(new Node <InterfaceMenuItem>(new InterfaceMenuItem
     {
         Title = np.Title,
         Name = np.Name,
         Target = np.Target,
         ToolTip = np.ToolTip,
         IconUrl = string.IsNullOrEmpty(np.IconClass) ? Retoken(np.IconUrl) : null,
         Url = Retoken(np.UrlFormat),
         IsDivider = np.IsDivider,
         IconClass = np.IconClass
     }));
 }