private static IAction CreateAction(
            string actionID,
            string path,
            WebBrowserComponent webBrowser)
        {
            string url      = ExtractUrlFromFavourite(path);
            string menuPath = CreateMenuPath(path);

            // Create the menu action
            ActionPath actionPath = new ActionPath(menuPath, null);
            MenuAction action     = new MenuAction(actionID, actionPath, ClickActionFlags.None, null);

            action.Label = actionPath.LastSegment.LocalizedText;

            // Set what we're supposed to do when the menu item is clicked
            action.SetClickHandler(
                delegate
            {
                // Navigate to the URL
                webBrowser.Url = url;
                webBrowser.Go();
            });

            return(action);
        }
Beispiel #2
0
 public void Go()
 {
     _component.Go();
 }