public GraphNode addNode(String Node, String Type) { string[] Groups = Node.Split('.'); GraphNode dbGroup = null; if (Groups.Length == 3) { dbGroup = graph.Nodes.GetOrCreate(Groups[0].ToUpper()); dbGroup.Label = Groups[0]; dbGroup.IsGroup = true; } GraphNode schemaGroup = null; if (Groups.Length >= 2) { schemaGroup = graph.Nodes.GetOrCreate(Groups[0].ToUpper() + "." + Groups[1].ToUpper()); schemaGroup.Label = Groups[0] + "." + Groups[1]; schemaGroup.IsGroup = true; if (dbGroup != null) { GraphLink gl = graph.Links.GetOrCreate(dbGroup, schemaGroup, "", GraphCommonSchema.Contains); } } GraphPropertyCollection properties = graph.DocumentSchema.Properties; GraphProperty background = properties.AddNewProperty("Background", typeof(Brush)); GraphProperty objecttype = properties.AddNewProperty("ObjectType", typeof(String)); GraphNode nodeSource = graph.Nodes.GetOrCreate(Node.ToUpper()); nodeSource.Label = Node; if (Type != "") { nodeSource[background] = getBrushForType(Type); nodeSource[objecttype] = Type; } if (schemaGroup != null) { GraphLink gl2 = graph.Links.GetOrCreate(schemaGroup, nodeSource, "", GraphCommonSchema.Contains); } return(nodeSource); }
public GraphNode addNodeNesting(String Node, String Type) { string[] Groups = Node.Split('.'); var newNode = GraphNodeRecurs(null, Groups, 0); if (Type != "") { GraphPropertyCollection properties = graph.DocumentSchema.Properties; GraphProperty background = properties.AddNewProperty("Background", typeof(Brush)); GraphProperty objecttype = properties.AddNewProperty("ObjectType", typeof(String)); newNode[background] = getBrushForType(Type); newNode[objecttype] = Type; } return(newNode); }
internal Assemble(Dictionary <string, string> options, Sources sources) { this.options = options; this.sources = sources; this.graph = new Graph(); this.nodes = new Dictionary <Dependency, GraphNode>(); // set properties GraphPropertyCollection properties = this.graph.DocumentSchema.Properties; this.size = properties.AddNewProperty("Size", typeof(string)); this.group = properties.AddNewProperty("Group", typeof(string)); this.reference = properties.AddNewProperty("Reference", typeof(string)); this.loc = properties.AddNewProperty("LOC", typeof(int)); this.sourcePath = options["source"]; var length = this.sourcePath.Length; if (length > 0 && this.sourcePath[length - 1] == System.IO.Path.DirectorySeparatorChar) { this.sourcePath = this.sourcePath.Substring(0, length - 2); } }