Example #1
0
        void LoadApplications(DirectoryInfo directoryInfo, Storage storage)
        {
            var fileInfo = directoryInfo.GetFiles("adlib.pbk");

            foreach (var file in fileInfo)
            {
                var path            = file.FullName.ToLower();
                var applicationInfo = new ApplicationInfo(path, storage);
                var applicationNode = new ApplicationNode(path, applicationInfo);
                Applications.Add(path, applicationNode);

                foreach (var dataSourceInfo in applicationInfo.DataSourceList)
                {
                    if (dataSourceInfo.DatabaseType == DatabaseType.NormalDatabase)
                    {
                        var dataSourceNode = new DataSourceNode(applicationInfo, dataSourceInfo);
                        Datasources.Add(dataSourceNode.Path, dataSourceNode);
                    }
                }
            }
        }
Example #2
0
        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);
            }
        }
Example #3
0
 internal void Add(string path, ApplicationNode applicationNode) => applications[path] = applicationNode;