Esempio n. 1
0
        private static void Main()
        {
            var assemblyPaths  = new[] { @".\OpenSoftware.DgmlBuilder.dll" };
            var excludeFilters = new IExcludeFilter[]
            {
                new ExcludeByNameSpace(x => x.Contains("OpenSoftware") == false),
                new ExcludeByNameSpace(x => x.EndsWith(".Annotations")),
                new ExcludeByCustomAttribute <CompilerGeneratedAttribute>()
            };

            using (var loader = new TypesLoader(assemblyPaths, excludeFilters))
            {
                var types = loader.Load().ToArray();
                var graph = TypesVisualizer.Types2Dgml(types);
                graph.WriteToFile(@"../../class-diagram.dgml");
            }
        }
Esempio n. 2
0
        private async Task _init(string connectionString)
        {
            JsonSerializer.SetDefaultResolver(StandardResolver.AllowPrivateCamelCase);

            _connection = new NpgsqlConnection(connectionString);
            await _connection.OpenAsync();

            DatabaseName        = _databaseName();
            SchemaEntities      = SchemasLoader.Load(_connection).ToImmutableArray();
            RelationEntities    = RelationsLoader.Load(_connection).ToImmutableArray();
            ColumnEntities      = ColumnsLoader.Load(_connection).ToImmutableArray();
            ForeignKeyEntities  = ForeignKeysLoader.Load(_connection).ToImmutableArray();
            UniqueIndexEntities = UniqueIndexesLoader.Load(_connection).ToImmutableArray();
            TypeEntities        = TypesLoader.Load(_connection).ToImmutableDictionary();
            SchemaRelations     = GetRelationSchemas();
            UsingNamespaces     = _usingNamespaces().ToImmutableArray();
            TypeMap             = _typesMap().ToImmutableDictionary();
            Keywords            = _keywords().ToImmutableSortedSet();
        }
Esempio n. 3
0
        private static void Main()
        {
            var assemblyPaths = new[] { @"OpenSoftware.DgmlBuilder.dll" };

            var excludeFilters = new IExcludeFilter[]
            {
                new ExcludeByNameSpace(x => x.Contains("OpenSoftware") == false),
                new ExcludeByNameSpace(x => x.EndsWith(".Annotations")),
                new ExcludeByCustomAttribute <CompilerGeneratedAttribute>()
            };

            using var loader = new TypesLoader(assemblyPaths, excludeFilters);
            var types = loader.Load().ToArray();
            var graph = TypesVisualizer.Types2Dgml(types);

            //graph.GraphDirection = GraphDirection.LeftToRight;
            //graph.Layout = Layout.Sugiyama;
            //graph.NeighborhoodDistance = 1;

            graph.WriteToFile(@"../../../class-diagram.dgml");
        }