public bool LoadMenuItems(ref string items)
 {
     _children = new HtmlElement_menuItemCollection(this.RootPointer, this);
     if (items.Length > 0)
     {
         if (items.StartsWith("[", StringComparison.Ordinal))
         {
             items = items.Substring(1);
             int pos = items.IndexOf(';');
             if (pos > 0)
             {
                 this.SetId(items.Substring(0, pos));
                 items = items.Substring(pos + 1);
             }
             pos = items.IndexOf(']');
             int pos2 = items.IndexOf('[');
             if (pos2 >= 0 && pos2 < pos)
             {
                 pos = pos2;
             }
             if (pos < 0)
             {
                 items = string.Empty;
                 return(false);
             }
             _text = items.Substring(0, pos);
             if (items[pos] == ']')
             {
                 items = items.Substring(pos + 1);
                 items = items.Trim();
                 return(true);
             }
             items = items.Substring(pos);
             items = items.Trim();
             while (items.Length > 0 && !items.StartsWith("]", StringComparison.Ordinal))
             {
                 HtmlElement_menuItem mi = new HtmlElement_menuItem(this.RootPointer);
                 if (mi.LoadMenuItems(ref items))
                 {
                     _children.Add(mi);
                 }
                 else
                 {
                     break;
                 }
             }
             if (items.Length > 0 && items.StartsWith("]", StringComparison.Ordinal))
             {
                 items = items.Substring(1);
                 items = items.Trim();
                 return(true);
             }
         }
     }
     items = string.Empty;
     return(false);
 }
        public static void AddMenuItemHandler(HtmlElement_menuItem e, Menu.MenuItemCollection mnu, EventHandler handler, Form caller)
        {
            MenuItem m0 = new MenuItemWithBitmap(e.Text, Resources._event1.ToBitmap());

            mnu.Add(m0);
            EventItem ei = new EventItem(e.Text, e, new EventInfoHtmlMenu(e));

            m0.Tag         = ei;
            ei.MenuOwner   = e;
            ei.MenuInvoker = caller;
            m0.Click      += handler;
            e.CreateContextMenu(m0.MenuItems, handler);
        }
        public void LoadMenuItems(string items)
        {
            _children = new HtmlElement_menuItemCollection(this.RootPointer, this);
            if (!string.IsNullOrEmpty(items))
            {
                items = items.Trim();

                while (items.Length > 0)
                {
                    HtmlElement_menuItem mi = new HtmlElement_menuItem(this.RootPointer);
                    if (mi.LoadMenuItems(ref items))
                    {
                        _children.Add(mi);
                    }
                }
            }
        }
 public EventInfoHtmlMenu(HtmlElement_menuItem item)
 {
     _item = item;
 }