コード例 #1
0
ファイル: bookmarks.cs プロジェクト: psryland/rylogic_code
        /// <summary>Add or remove a bookmark at 'row_index'</summary>
        private void SetBookmark(int row_index, Bit.EState bookmarked)
        {
            if (row_index < 0 || row_index >= m_line_index.Count)
            {
                return;
            }
            var line = m_line_index[row_index];

            SetBookmark(line, bookmarked);

            // Restore the selected row
            SelectedRowIndex = row_index;
        }
コード例 #2
0
ファイル: bookmarks.cs プロジェクト: psryland/rylogic_code
        /// <summary>Sets or clears the bookmark at file address 'addr'</summary>
        private void SetBookmark(RangeI line, Bit.EState bookmarked)
        {
            // Look for the bookmark
            var idx = Bookmarks.BinarySearch(b => b.Position.CompareTo(line.Beg));

            if (idx >= 0 && bookmarked != Bit.EState.Set)
            {
                // Bookmark was found, remove it
                Bookmarks.RemoveAt(idx);
            }
            else if (idx < 0 && bookmarked != Bit.EState.Clear)
            {
                // Bookmark not found, insert it
                Bookmarks.Insert(~idx, new Bookmark(line, ReadLine(line).RowText));
            }
            m_batch_refresh_bkmks.Signal();
        }