public void CreateEdges(DataSourceList datasources, MethodList methods, ScreenList screens, DatabaseList databases, FieldList fields, IndexList indexes) { foreach (var applicationNode in applications.Values) { applicationNode.Application.DataSourceList.ForEach((dataSourceInfo) => AddDataSourceEdgeToApplicationNode(applicationNode, dataSourceInfo, datasources, methods, screens, databases, fields, indexes)); } foreach (var applicationNode in applications.Values) { ColorEdges(applicationNode); } }
internal void CreateEdges(FieldList fields, IndexList indexes, ScreenList screens) { foreach (var database in databases.Values) { var databaseInfo = database.Database; var databaseNode = FindDatabaseNode(databaseInfo); if (databaseNode != null) { foreach (var fieldInfo in databaseInfo.FieldInfoCollection.Values) { var fieldNode = fields.FindFieldNode(databaseInfo, fieldInfo.Tag); if (fieldInfo.IsLinked) { LinkFieldNodeToDatabaseNode(databaseNode, fieldNode); var linkedFieldNode = fields.FindFieldNode(databaseInfo, fieldInfo.LinkRefTag); if (fieldNode != null && linkedFieldNode != null) { AddEdge(fieldNode, AdlibEdgeType.UsesLinkRef, linkedFieldNode); foreach (var indexNode in indexes.FindIndexNodes(databaseInfo, fieldInfo.LinkRefTag)) { AddEdge(linkedFieldNode, AdlibEdgeType.IndexedIn, indexNode); } } screens.LinkScreenToNode(databaseInfo, fieldNode, fieldInfo.LinkScreen, AdlibEdgeType.UsesLinkScreen); screens.LinkScreenToNode(databaseInfo, fieldNode, fieldInfo.ZoomScreen, AdlibEdgeType.UsesZoomScreen); screens.LinkScreenToNode(databaseInfo, fieldNode, fieldInfo.EditScreen, AdlibEdgeType.UsesEditScreen); } if (!fieldInfo.IsLinkRef) { LinkFieldNodeToDatabaseNode(databaseNode, fieldNode); foreach (var indexNode in indexes.FindIndexNodes(databaseInfo, fieldInfo.Tag)) { AddEdge(fieldNode, AdlibEdgeType.IndexedIn, indexNode); } } } } } }
internal void LinkMethodToNode(ApplicationInfo applicationInfo, AdlibNode dataSourceNode, MethodInfo methodInfo, ScreenList screens) { var methodNode = new MethodNode(dataSourceNode.Path, methodInfo); methods[methodNode.Path] = methodNode; AddEdge(dataSourceNode, AdlibEdgeType.HasMethod, methodNode); methodInfo.ListScreenList.ForEach((screen) => screens.LinkScreenToNode(applicationInfo, dataSourceNode, screen, AdlibEdgeType.UsesListScreen)); methodInfo.DetailScreenList.ForEach((screen) => screens.LinkScreenToNode(applicationInfo, dataSourceNode, screen, AdlibEdgeType.UsesListScreen)); }
void AddDataSourceEdgeToApplicationNode(ApplicationNode applicationNode, DataSourceInfo dataSourceInfo, DataSourceList datasources, MethodList methods, ScreenList screens, DatabaseList databases, FieldList fields, IndexList indexes) { var applicationInfo = applicationNode.Application; if (dataSourceInfo.DatabaseType == DatabaseType.NormalDatabase) { var dataSourceNode = datasources.FindDataSourceNode(applicationInfo, dataSourceInfo); AddEdge(applicationNode, AdlibEdgeType.HasDataSource, dataSourceNode); dataSourceInfo.ListScreenList.ForEach(screenName => screens.LinkScreenToNode(applicationInfo, dataSourceNode, screenName, AdlibEdgeType.UsesListScreen)); dataSourceInfo.DetailScreenList.ForEach(screenName => screens.LinkScreenToNode(applicationInfo, dataSourceNode, screenName, AdlibEdgeType.UsesDetailScreen)); dataSourceInfo.MethodList.ForEach(methodInfo => methods.LinkMethodToNode(applicationInfo, dataSourceNode, methodInfo, screens)); var databasePath = DatabasePath(applicationInfo, dataSourceInfo); screens.LinkScreensToDataSourceNode(applicationInfo, databases, fields, indexes, dataSourceInfo.DetailScreenList, databasePath); screens.LinkScreensToDataSourceNode(applicationInfo, databases, fields, indexes, dataSourceInfo.ListScreenList, databasePath); } }