コード例 #1
0
 private void fireBookmarkRemoved(Bookmark bookmark)
 {
     if (BookmarkRemoved != null)
     {
         BookmarkRemoved.Invoke(bookmark);
     }
 }
コード例 #2
0
        private void uiBookmarksDataGridView_CellClick(object sender, DataGridViewCellEventArgs e)
        {
            int col = e.ColumnIndex;

            if (col < 0)
            {
                return;
            }

            int             rowIndex = e.RowIndex;
            DataGridViewRow row      = uiBookmarksDataGridView.Rows[rowIndex];
            string          key      = "";

            switch (col)
            {
            case 0:
                DialogResult dr = MessageBox.Show("This will remove this bookmark. Are you sure?", "Remove Bookmark?", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Question);
                if (dr != DialogResult.Yes)
                {
                    return;
                }
                key = row.Cells[1].Value.ToString();
                OsirtHelper.Favourites.Remove(key);
                uiBookmarksDataGridView.Rows.Remove(row);
                uiBookmarksDataGridView.Update();
                uiBookmarksDataGridView.Refresh();
                OsirtHelper.WriteFavourites();
                BookmarkRemoved?.Invoke(this, EventArgs.Empty);
                break;

            case 2:
                //click link
                key = row.Cells[2].Value.ToString();
                LinkClicked?.Invoke(this, new TextEventArgs(key));
                break;
            }
        }
コード例 #3
0
 protected void OnBookmarkRemoved()
 {
     BookmarkRemoved?.Invoke(this, EventArgs.Empty);
 }