Exemplo n.º 1
0
        public void Test_Initialize()
        {
            manager = new BookmarkManager(bookmarksPath);

            manager.AddBookmark(new Bookmark()
            {
                Name            = "Grand Blue",
                SeriesUri       = new ValidatedUri("http://test.manga.com/grand_blue"),
                SaveDestination = "D:/manga/grand_blue",
                DateAdded       = DateTime.Now.Ticks,
                DateUpdated     = DateTime.Now.Ticks,
                Site            = "test-manga"
            });


            manager.AddBookmark(new Bookmark()
            {
                Name            = "Crows",
                SeriesUri       = new ValidatedUri("http://test.manga.com/crows"),
                SaveDestination = "D:/manga/crows",
                DateAdded       = DateTime.Now.Ticks,
                DateUpdated     = DateTime.Now.Ticks,
                Site            = "test-manga"
            });

            manager.AddBookmark(new Bookmark()
            {
                Name            = "Minamoto-kun Monogatari",
                SeriesUri       = new ValidatedUri("http://test.manga.com/minamoto-kun_monogatari"),
                SaveDestination = "D:/manga/minamoto-kun_monogatari",
                Site            = "test-manga"
            });
        }
Exemplo n.º 2
0
        private void btnSave_Click(object sender, EventArgs e)
        {
            BookmarkFolder bookmarkFolder = comboBoxBookmarkFolders.SelectedItem as BookmarkFolder ?? _bookmarkManager.RootFolder;

            _bookmarkManager.AddBookmark(bookmarkFolder.Id, txtBookmarkName.Text, _imageReference);
            _bookmarkService.SaveBookmarks();
        }
Exemplo n.º 3
0
        public void Test_Add_Duplicate_Bookmark()
        {
            var minamoto = new Bookmark()
            {
                Name            = "Minamoto-kun Monogatari",
                SeriesUri       = new ValidatedUri("http://test.manga.com/minamoto-kun_monogatari"),
                SaveDestination = "D:/manga/minamoto-kun_monogatari",
                Site            = "test-manga"
            };

            Assert.AreEqual(manager.AddBookmark(minamoto), AddBookmarkStatus.Duplicate);
        }
Exemplo n.º 4
0
        private void mnuMenuBookmarksAdd_Click(object sender, RoutedEventArgs e)
        {
            var bmManager = new BookmarkManager(this, BrowserControl);

            bmManager.AddBookmark(txtUrl.Text, BrowserControl.GetTitle());
            var url = txtUrl.Text;
        }
Exemplo n.º 5
0
        private void addButton_Click(object sender, EventArgs e)
        {
            var bookmark = new Bookmark();

            //TODO: When we add bookmarks we should make the name New Bookmark for the first bookmark.
            //      New Bookmark (2) for the second. New Bookmark (3) for the third.
            bookmark.Name = "New Bookmark";
            BookmarkManager.AddBookmark(bookmark, false);
            selectedBookmark = bookmark;
            PopulateList();
            bookmarkEntryControl.ShowPasswordBox(true);
            bookmarkEntryControl.Focus();
        }
        private void btnSave_Click(object sender, EventArgs e)
        {
            if (!ValidateBookmarkName())
            {
                MessageBox.Show(this, "Invalid bookmark name", "Invalid name", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                return;
            }

            if (ParentForm != null)
            {
                BookmarkFolder bookmarkFolder = bookmarksTree.SelectedNode.Tag as BookmarkFolder ?? _bookmarkManager.RootFolder;
                _bookmarkManager.AddBookmark(bookmarkFolder.Id, txtBookmarkName.Text, _imageReference);
                _bookmarkService.SaveBookmarks();

                ParentForm.DialogResult = DialogResult.OK;
            }
        }
Exemplo n.º 7
0
 private void SaveAndSelectBookmark(Bookmark bookmark)
 {
     BookmarkManager.RemoveBookmark(SelectedBookmark);
     BookmarkManager.AddBookmark(bookmark, false);
     SelectedBookmark = bookmark;
 }