Ejemplo n.º 1
0
        // TODO: Copypaste is heresy.
        private void CreateNode(Repo.INode node)
        {
            var vertex = new DataVertex(node.Name)
            {
                Node       = node,
                VertexType = DataVertex.VertexTypeEnum.Node,
                Picture    = node.Class.Shape
            };

            var attributeInfos = node.Attributes.Select(x => new DataVertex.Attribute()
            {
                Name  = x.Name,
                Type  = x.Kind.ToString(),
                Value = x.StringValue
            });

            attributeInfos.ToList().ForEach(x => vertex.Attributes.Add(x));

            this.dataGraph.AddVertex(vertex);
            this.DrawNewVertex(vertex);
            this.DrawGraph();
        }