Esempio n. 1
0
        public IEnumerable <GitEdge> GetEdges()
        {
            var edges = new Dictionary <string, GitEdge>();

            Edges
            .Values
            .ForEach(e =>
            {
                var source = Vertices.GetValueOrDefault(e.Source);
                var target = Vertices.GetValueOrDefault(e.Target);
                if (source == null || target == null)
                {
                    return;
                }
                var edge = new GitEdge(source, target, e.Tag);
                if (edges.ContainsKey(edge.Key))
                {
                    var existing = edges[edge.Key];
                    if (!existing.Tag.Contains(e.Tag))
                    {
                        existing.Tag.Add(e.Tag);
                    }
                }
                else
                {
                    edges.Add(edge.Key, edge);
                }
            });
            return(edges.Values);
        }
Esempio n. 2
0
 protected bool Equals(GitEdge other)
 {
     return(string.Equals(TargetKey, other.TargetKey) && string.Equals(SourceKey, other.SourceKey));
 }