Пример #1
0
        private void mOKButton_Click(object sender, System.EventArgs e)
        {
            String            destinationFolder = "Bookmarks"; // XXX Parameterize this
            ManticoreTreeNode node = mFolderTree.SelectedNode as ManticoreTreeNode;

            if (node != null)
            {
                destinationFolder = node.Data as String;
            }
            Bookmarks bmks       = ServiceManager.Bookmarks;
            String    bookmarkID = bmks.CreateBookmark(mNameField.Text, destinationFolder, -1);

            bmks.SetBookmarkAttribute(bookmarkID, "url", mLocationField.Text);
            Close();
        }
Пример #2
0
        protected void OnTreeDoubleClick(Object sender, EventArgs e)
        {
            ManticoreTreeNode node        = mBookmarksTree.SelectedNode as ManticoreTreeNode;
            Bookmarks         bmks        = ServiceManager.Bookmarks;
            String            bookmarkURL = bmks.GetBookmarkAttribute(node.Data as String, "url");

            if (bookmarkURL != "")
            {
                WindowMediator wm     = ServiceManager.WindowMediator;
                BrowserWindow  window = wm.GetMostRecentWindow("BrowserWindow") as BrowserWindow;
                if (window != null)
                {
                    window.LoadURL(bookmarkURL);
                }
            }
        }
Пример #3
0
        public override bool ShouldBuild(CommandTarget aTarget)
        {
            Bookmarks bmks = ServiceManager.Bookmarks;

            if (mFilterAttributes != null)
            {
                IEnumerator criteria = mFilterAttributes.GetEnumerator();
                while (criteria.MoveNext())
                {
                    String[] singleCriteria = criteria.Current as String[];
                    if (bmks.GetBookmarkAttribute(aTarget.Data as String, singleCriteria[0]) != singleCriteria[1])
                    {
                        return(false);
                    }
                }
            }
            return(true);
        }
Пример #4
0
        protected void OnAfterLabelEdit(Object sender, NodeLabelEditEventArgs e)
        {
            ManticoreTreeNode root = GetRootItem();

            if (root != null && e.Label != "")
            {
                ManticoreTreeNode temp       = e.Node as ManticoreTreeNode;
                String            parentID   = root.Data as String;
                Bookmarks         bmks       = ServiceManager.Bookmarks;
                String            bookmarkID = bmks.CreateBookmark(e.Label, parentID, -1);
                bmks.SetBookmarkAttribute(bookmarkID, "container", "true");
                bmks.SetBookmarkAttribute(bookmarkID, "open", "true");
                e.Node.Text = "FruitLoop";
                e.Node.EndEdit(false);
                root.Nodes.Remove(temp);
                LabelEdit = false;
            }
            else
            {
                e.Node.EndEdit(true);
            }
        }