Пример #1
0
        public bool AddEdge(int origin, int target)
        {
            var result = _edges.AddOneToOne(origin, target);

            if (result)
            {
                _numberOfEdges++;
            }

            return(result);
        }
Пример #2
0
        private void TryAddEdge(int dataId, int callbackId)
        {
            // The callback is called when the data is modified
            _dataToRegisteredCallbacks.AddOneToOne(dataId, callbackId);

            int publishingCallback;

            if (_publishedDataToPublishingCallback.TryGetValue(dataId, out publishingCallback))
            {
                // we have found the id of a callback who publishes dataId when called
                _graph.AddEdge(publishingCallback, callbackId);
            }
        }