コード例 #1
0
        IReadOnlyList <Breakpoint> IBreakpoints.SetBreakpoints(Source source, IReadOnlyList <SourceBreakpoint> sourceBreakpoints)
        {
            lock (_gate)
            {
                var path = source.Path;
                foreach (var row in _rows.Items)
                {
                    if (row.FunctionBreakpoint == null && PathEquals(row.Source.Path, path))
                    {
                        _rows.Remove(row);
                    }
                }

                var breakpoints = new List <Breakpoint>(sourceBreakpoints.Count);

                foreach (var sourceBreakpoint in sourceBreakpoints)
                {
                    var row = new Row(source, sourceBreakpoint);
                    TryUpdate(row);
                    breakpoints.Add(row.Breakpoint);
                }

                RebuildItems();

                return(breakpoints);
            }
        }
コード例 #2
0
        ulong IIdentifier <T> .Add(T item)
        {
            if (_inner.TryGetValue(item, out var code))
            {
                return(code);
            }

            while (_queue.Count >= _count)
            {
                var head = _queue.Dequeue();
                _inner.Remove(head);
            }

            return(_inner.Add(item));
        }
コード例 #3
0
 void IIdentifier <T> .Remove(T item)
 {
     lock (_gate)
     {
         _inner.Remove(item);
     }
 }