From ebd2b378044978ee2f123d2bacbf9f4b94aa513c Mon Sep 17 00:00:00 2001 From: Bastien Olivier Dijkstra Date: Wed, 17 May 2023 09:53:52 +0200 Subject: [PATCH 1/2] Upgrade to dotnet 7 --- .editorconfig | 90 + AnalysisReport.sarif | 1241 + CSharpSyntaxWalkerTest/App.config | 14 +- .../CSharpSyntaxWalkerTest.csproj | 177 +- CSharpSyntaxWalkerTest/Program.cs | 34 +- .../Properties/AssemblyInfo.cs | 13 +- CSharpSyntaxWalkerTest/packages.config | 46 - DiagramGenerator.sln | 9 +- DiagramGenerator/CSharpAnalyzer.cs | 44 +- DiagramGenerator/CSharpObjects.cs | 153 +- DiagramGenerator/CSharpVisitor.cs | 87 +- DiagramGenerator/ConfigFile.cs | 32 +- DiagramGenerator/DiagramGenerator.csproj | 85 +- DiagramGenerator/Program.cs | 36 +- DiagramGenerator/Properties/AssemblyInfo.cs | 13 +- DiagramGenerator/Settings.cs | 19 +- DiagramGenerator/UmlGenerator.cs | 23 +- DiagramGenerator/app.config | 3 + DiagramGenerator/packages.config | 16 - DiagramGeneratorUI/App.config | 8 +- DiagramGeneratorUI/App.xaml | 4 +- DiagramGeneratorUI/App.xaml.cs | 10 +- DiagramGeneratorUI/DiagramGeneratorUI.csproj | 116 +- DiagramGeneratorUI/MainWindow.xaml | 64 +- DiagramGeneratorUI/MainWindow.xaml.cs | 73 +- DiagramGeneratorUI/Properties/AssemblyInfo.cs | 22 +- .../Properties/Resources.Designer.cs | 2 +- .../Properties/Settings.Designer.cs | 2 +- UpgradeReport.sarif | 1335 + upgrade-assistant.clef | 46668 ++++++++++++++++ 30 files changed, 49719 insertions(+), 720 deletions(-) create mode 100644 .editorconfig create mode 100644 AnalysisReport.sarif delete mode 100644 CSharpSyntaxWalkerTest/packages.config create mode 100644 DiagramGenerator/app.config delete mode 100644 DiagramGenerator/packages.config create mode 100644 UpgradeReport.sarif create mode 100644 upgrade-assistant.clef diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..8775759 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,90 @@ +[*.cs] + +# SYSLIB0011: Type or member is obsolete +dotnet_diagnostic.SYSLIB0011.severity = none +csharp_indent_labels = one_less_than_current +csharp_using_directive_placement = outside_namespace:silent +csharp_prefer_simple_using_statement = true:suggestion +csharp_prefer_braces = true:silent +csharp_style_namespace_declarations = block_scoped:silent +csharp_style_prefer_method_group_conversion = true:silent +csharp_style_prefer_top_level_statements = true:silent +csharp_style_expression_bodied_methods = false:silent +csharp_style_expression_bodied_constructors = false:silent +csharp_style_expression_bodied_operators = false:silent +csharp_style_expression_bodied_properties = true:silent +csharp_style_expression_bodied_indexers = true:silent +csharp_style_expression_bodied_accessors = true:silent +csharp_style_expression_bodied_lambdas = true:silent +csharp_style_expression_bodied_local_functions = false:silent +csharp_style_throw_expression = true:suggestion +csharp_style_prefer_null_check_over_type_check = true:suggestion +csharp_prefer_simple_default_expression = true:suggestion + +[*.{cs,vb}] +dotnet_style_operator_placement_when_wrapping = beginning_of_line +tab_width = 4 +indent_size = 4 +end_of_line = crlf +dotnet_style_coalesce_expression = true:suggestion +dotnet_style_null_propagation = true:suggestion +dotnet_style_prefer_is_null_check_over_reference_equality_method = true:suggestion +dotnet_style_prefer_auto_properties = true:silent +dotnet_style_object_initializer = true:suggestion +dotnet_style_collection_initializer = true:suggestion +dotnet_style_prefer_simplified_boolean_expressions = true:suggestion +dotnet_style_prefer_conditional_expression_over_assignment = true:silent +dotnet_style_prefer_conditional_expression_over_return = true:silent +dotnet_style_explicit_tuple_names = true:suggestion +dotnet_style_prefer_inferred_tuple_names = true:suggestion +dotnet_style_prefer_inferred_anonymous_type_member_names = true:suggestion +dotnet_style_prefer_compound_assignment = true:suggestion +dotnet_style_prefer_simplified_interpolation = true:suggestion +dotnet_style_namespace_match_folder = true:suggestion +[*.{cs,vb}] +#### Naming styles #### + +# Naming rules + +dotnet_naming_rule.interface_should_be_begins_with_i.severity = suggestion +dotnet_naming_rule.interface_should_be_begins_with_i.symbols = interface +dotnet_naming_rule.interface_should_be_begins_with_i.style = begins_with_i + +dotnet_naming_rule.types_should_be_pascal_case.severity = suggestion +dotnet_naming_rule.types_should_be_pascal_case.symbols = types +dotnet_naming_rule.types_should_be_pascal_case.style = pascal_case + +dotnet_naming_rule.non_field_members_should_be_pascal_case.severity = suggestion +dotnet_naming_rule.non_field_members_should_be_pascal_case.symbols = non_field_members +dotnet_naming_rule.non_field_members_should_be_pascal_case.style = pascal_case + +# Symbol specifications + +dotnet_naming_symbols.interface.applicable_kinds = interface +dotnet_naming_symbols.interface.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected +dotnet_naming_symbols.interface.required_modifiers = + +dotnet_naming_symbols.types.applicable_kinds = class, struct, interface, enum +dotnet_naming_symbols.types.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected +dotnet_naming_symbols.types.required_modifiers = + +dotnet_naming_symbols.non_field_members.applicable_kinds = property, event, method +dotnet_naming_symbols.non_field_members.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected +dotnet_naming_symbols.non_field_members.required_modifiers = + +# Naming styles + +dotnet_naming_style.begins_with_i.required_prefix = I +dotnet_naming_style.begins_with_i.required_suffix = +dotnet_naming_style.begins_with_i.word_separator = +dotnet_naming_style.begins_with_i.capitalization = pascal_case + +dotnet_naming_style.pascal_case.required_prefix = +dotnet_naming_style.pascal_case.required_suffix = +dotnet_naming_style.pascal_case.word_separator = +dotnet_naming_style.pascal_case.capitalization = pascal_case + +dotnet_naming_style.pascal_case.required_prefix = +dotnet_naming_style.pascal_case.required_suffix = +dotnet_naming_style.pascal_case.word_separator = +dotnet_naming_style.pascal_case.capitalization = pascal_case diff --git a/AnalysisReport.sarif b/AnalysisReport.sarif new file mode 100644 index 0000000..7c0ec7b --- /dev/null +++ b/AnalysisReport.sarif @@ -0,0 +1,1241 @@ +{ + "$schema": "https://schemastore.azurewebsites.net/schemas/json/sarif-2.1.0-rtm.5.json", + "version": "2.1.0", + "runs": [ + { + "tool": { + "driver": { + "name": "Dependency Analysis", + "semanticVersion": "0.4.421302", + "informationUri": "https://docs.microsoft.com/en-us/dotnet/core/porting/upgrade-assistant-overview", + "rules": [ + { + "id": "UA105", + "name": "PackageToBeDeleted", + "fullDescription": { + "text": "Packages that need to be deleted in order to upgrade the project to chosen TFM" + }, + "helpUri": "https://docs.microsoft.com/en-us/dotnet/core/porting/upgrade-assistant-overview" + }, + { + "id": "UA106", + "name": "PackageToBeAdded", + "fullDescription": { + "text": "Packages that need to be added in order to upgrade the project to chosen TFM" + }, + "helpUri": "https://docs.microsoft.com/en-us/dotnet/core/porting/upgrade-assistant-overview" + } + ] + } + }, + "results": [ + { + "ruleId": "UA105", + "level": "note", + "message": { + "text": "Package System.Collections, Version=4.0.0 does not support the target(s) net7.0 but a newer version (4.3.0) does. Package System.Collections needs to be upgraded from 4.0.0 to 4.3.0." + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "file:///C:/Users/dijkstrab/diagram-generator/DiagramGenerator/DiagramGenerator.csproj" + }, + "region": {} + } + } + ] + }, + { + "ruleId": "UA105", + "level": "note", + "message": { + "text": "Package System.Collections.Immutable, Version=1.1.37 needs to be deleted." + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "file:///C:/Users/dijkstrab/diagram-generator/DiagramGenerator/DiagramGenerator.csproj" + }, + "region": {} + } + } + ] + }, + { + "ruleId": "UA105", + "level": "note", + "message": { + "text": "Package System.Diagnostics.Debug, Version=4.0.0 needs to be deleted." + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "file:///C:/Users/dijkstrab/diagram-generator/DiagramGenerator/DiagramGenerator.csproj" + }, + "region": {} + } + } + ] + }, + { + "ruleId": "UA105", + "level": "note", + "message": { + "text": "Package System.Globalization, Version=4.0.0 needs to be deleted." + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "file:///C:/Users/dijkstrab/diagram-generator/DiagramGenerator/DiagramGenerator.csproj" + }, + "region": {} + } + } + ] + }, + { + "ruleId": "UA105", + "level": "note", + "message": { + "text": "Package System.Linq, Version=4.0.0 needs to be deleted." + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "file:///C:/Users/dijkstrab/diagram-generator/DiagramGenerator/DiagramGenerator.csproj" + }, + "region": {} + } + } + ] + }, + { + "ruleId": "UA105", + "level": "note", + "message": { + "text": "Package System.Resources.ResourceManager, Version=4.0.0 needs to be deleted." + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "file:///C:/Users/dijkstrab/diagram-generator/DiagramGenerator/DiagramGenerator.csproj" + }, + "region": {} + } + } + ] + }, + { + "ruleId": "UA105", + "level": "note", + "message": { + "text": "Package System.Runtime, Version=4.0.0 needs to be deleted." + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "file:///C:/Users/dijkstrab/diagram-generator/DiagramGenerator/DiagramGenerator.csproj" + }, + "region": {} + } + } + ] + }, + { + "ruleId": "UA105", + "level": "note", + "message": { + "text": "Package System.Runtime.Extensions, Version=4.0.0 needs to be deleted." + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "file:///C:/Users/dijkstrab/diagram-generator/DiagramGenerator/DiagramGenerator.csproj" + }, + "region": {} + } + } + ] + }, + { + "ruleId": "UA105", + "level": "note", + "message": { + "text": "Package System.Threading, Version=4.0.0 needs to be deleted." + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "file:///C:/Users/dijkstrab/diagram-generator/DiagramGenerator/DiagramGenerator.csproj" + }, + "region": {} + } + } + ] + }, + { + "ruleId": "UA105", + "level": "note", + "message": { + "text": "Package Microsoft.CodeAnalysis.Analyzers, Version=1.1.0 needs to be deleted." + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "file:///C:/Users/dijkstrab/diagram-generator/DiagramGenerator/DiagramGenerator.csproj" + }, + "region": {} + } + } + ] + }, + { + "ruleId": "UA105", + "level": "note", + "message": { + "text": "Package Microsoft.CodeAnalysis.Common, Version=1.3.2 needs to be deleted." + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "file:///C:/Users/dijkstrab/diagram-generator/DiagramGenerator/DiagramGenerator.csproj" + }, + "region": {} + } + } + ] + }, + { + "ruleId": "UA105", + "level": "note", + "message": { + "text": "Package System.Collections, Version=4.0.0 needs to be deleted." + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "file:///C:/Users/dijkstrab/diagram-generator/DiagramGenerator/DiagramGenerator.csproj" + }, + "region": {} + } + } + ] + }, + { + "ruleId": "UA105", + "level": "note", + "message": { + "text": "Package System.Reflection.Metadata, Version=1.2.0 needs to be deleted." + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "file:///C:/Users/dijkstrab/diagram-generator/DiagramGenerator/DiagramGenerator.csproj" + }, + "region": {} + } + } + ] + }, + { + "ruleId": "UA106", + "level": "note", + "message": { + "text": "Package System.Collections, Version=4.3.0 needs to be added." + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "file:///C:/Users/dijkstrab/diagram-generator/DiagramGenerator/DiagramGenerator.csproj" + }, + "region": {} + } + } + ] + }, + { + "ruleId": "UA106", + "level": "note", + "message": { + "text": "Package System.Collections.Immutable, Version=1.7.1 needs to be added." + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "file:///C:/Users/dijkstrab/diagram-generator/DiagramGenerator/DiagramGenerator.csproj" + }, + "region": {} + } + } + ] + }, + { + "ruleId": "UA106", + "level": "note", + "message": { + "text": "Package System.Diagnostics.Debug, Version=4.3.0 needs to be added." + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "file:///C:/Users/dijkstrab/diagram-generator/DiagramGenerator/DiagramGenerator.csproj" + }, + "region": {} + } + } + ] + }, + { + "ruleId": "UA106", + "level": "note", + "message": { + "text": "Package System.Globalization, Version=4.3.0 needs to be added." + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "file:///C:/Users/dijkstrab/diagram-generator/DiagramGenerator/DiagramGenerator.csproj" + }, + "region": {} + } + } + ] + }, + { + "ruleId": "UA106", + "level": "note", + "message": { + "text": "Package System.Linq, Version=4.3.0 needs to be added." + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "file:///C:/Users/dijkstrab/diagram-generator/DiagramGenerator/DiagramGenerator.csproj" + }, + "region": {} + } + } + ] + }, + { + "ruleId": "UA106", + "level": "note", + "message": { + "text": "Package System.Resources.ResourceManager, Version=4.3.0 needs to be added." + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "file:///C:/Users/dijkstrab/diagram-generator/DiagramGenerator/DiagramGenerator.csproj" + }, + "region": {} + } + } + ] + }, + { + "ruleId": "UA106", + "level": "note", + "message": { + "text": "Package System.Runtime, Version=4.3.1 needs to be added." + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "file:///C:/Users/dijkstrab/diagram-generator/DiagramGenerator/DiagramGenerator.csproj" + }, + "region": {} + } + } + ] + }, + { + "ruleId": "UA106", + "level": "note", + "message": { + "text": "Package System.Runtime.Extensions, Version=4.3.1 needs to be added." + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "file:///C:/Users/dijkstrab/diagram-generator/DiagramGenerator/DiagramGenerator.csproj" + }, + "region": {} + } + } + ] + }, + { + "ruleId": "UA106", + "level": "note", + "message": { + "text": "Package System.Threading, Version=4.3.0 needs to be added." + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "file:///C:/Users/dijkstrab/diagram-generator/DiagramGenerator/DiagramGenerator.csproj" + }, + "region": {} + } + } + ] + }, + { + "ruleId": "UA106", + "level": "note", + "message": { + "text": "Package Microsoft.DotNet.UpgradeAssistant.Extensions.Default.Analyzers, Version=0.4.421302 needs to be added." + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "file:///C:/Users/dijkstrab/diagram-generator/DiagramGenerator/DiagramGenerator.csproj" + }, + "region": {} + } + } + ] + }, + { + "ruleId": "UA106", + "level": "note", + "message": { + "text": "Package Microsoft.DotNet.UpgradeAssistant.Extensions.Default.Analyzers, Version=0.4.421302 needs to be added." + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "file:///C:/Users/dijkstrab/diagram-generator/DiagramGeneratorUI/DiagramGeneratorUI.csproj" + }, + "region": {} + } + } + ] + }, + { + "ruleId": "UA106", + "level": "note", + "message": { + "text": "Package Microsoft.Windows.Compatibility, Version=7.0.1 needs to be added." + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "file:///C:/Users/dijkstrab/diagram-generator/DiagramGeneratorUI/DiagramGeneratorUI.csproj" + }, + "region": {} + } + } + ] + }, + { + "ruleId": "UA105", + "level": "note", + "message": { + "text": "Package Microsoft.CodeAnalysis.Analyzers needs to be removed as its a transitive dependency that is not required" + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "file:///C:/Users/dijkstrab/diagram-generator/CSharpSyntaxWalkerTest/CSharpSyntaxWalkerTest.csproj" + }, + "region": {} + } + } + ] + }, + { + "ruleId": "UA105", + "level": "note", + "message": { + "text": "Package Microsoft.CodeAnalysis.Common, Version=2.0.0 needs to be deleted." + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "file:///C:/Users/dijkstrab/diagram-generator/CSharpSyntaxWalkerTest/CSharpSyntaxWalkerTest.csproj" + }, + "region": {} + } + } + ] + }, + { + "ruleId": "UA105", + "level": "note", + "message": { + "text": "Package System.AppContext, Version=4.3.0 needs to be deleted." + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "file:///C:/Users/dijkstrab/diagram-generator/CSharpSyntaxWalkerTest/CSharpSyntaxWalkerTest.csproj" + }, + "region": {} + } + } + ] + }, + { + "ruleId": "UA105", + "level": "note", + "message": { + "text": "Package System.Collections, Version=4.3.0 needs to be deleted." + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "file:///C:/Users/dijkstrab/diagram-generator/CSharpSyntaxWalkerTest/CSharpSyntaxWalkerTest.csproj" + }, + "region": {} + } + } + ] + }, + { + "ruleId": "UA105", + "level": "note", + "message": { + "text": "Package System.Collections.Concurrent, Version=4.3.0 needs to be deleted." + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "file:///C:/Users/dijkstrab/diagram-generator/CSharpSyntaxWalkerTest/CSharpSyntaxWalkerTest.csproj" + }, + "region": {} + } + } + ] + }, + { + "ruleId": "UA105", + "level": "note", + "message": { + "text": "Package System.Collections.Immutable, Version=1.3.1 needs to be deleted." + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "file:///C:/Users/dijkstrab/diagram-generator/CSharpSyntaxWalkerTest/CSharpSyntaxWalkerTest.csproj" + }, + "region": {} + } + } + ] + }, + { + "ruleId": "UA105", + "level": "note", + "message": { + "text": "Package System.Console, Version=4.3.0 needs to be deleted." + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "file:///C:/Users/dijkstrab/diagram-generator/CSharpSyntaxWalkerTest/CSharpSyntaxWalkerTest.csproj" + }, + "region": {} + } + } + ] + }, + { + "ruleId": "UA105", + "level": "note", + "message": { + "text": "Package System.Diagnostics.Debug, Version=4.3.0 needs to be deleted." + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "file:///C:/Users/dijkstrab/diagram-generator/CSharpSyntaxWalkerTest/CSharpSyntaxWalkerTest.csproj" + }, + "region": {} + } + } + ] + }, + { + "ruleId": "UA105", + "level": "note", + "message": { + "text": "Package System.Diagnostics.FileVersionInfo, Version=4.3.0 needs to be deleted." + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "file:///C:/Users/dijkstrab/diagram-generator/CSharpSyntaxWalkerTest/CSharpSyntaxWalkerTest.csproj" + }, + "region": {} + } + } + ] + }, + { + "ruleId": "UA105", + "level": "note", + "message": { + "text": "Package System.Diagnostics.StackTrace, Version=4.3.0 needs to be deleted." + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "file:///C:/Users/dijkstrab/diagram-generator/CSharpSyntaxWalkerTest/CSharpSyntaxWalkerTest.csproj" + }, + "region": {} + } + } + ] + }, + { + "ruleId": "UA105", + "level": "note", + "message": { + "text": "Package System.Diagnostics.Tools, Version=4.3.0 needs to be deleted." + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "file:///C:/Users/dijkstrab/diagram-generator/CSharpSyntaxWalkerTest/CSharpSyntaxWalkerTest.csproj" + }, + "region": {} + } + } + ] + }, + { + "ruleId": "UA105", + "level": "note", + "message": { + "text": "Package System.Dynamic.Runtime, Version=4.3.0 needs to be deleted." + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "file:///C:/Users/dijkstrab/diagram-generator/CSharpSyntaxWalkerTest/CSharpSyntaxWalkerTest.csproj" + }, + "region": {} + } + } + ] + }, + { + "ruleId": "UA105", + "level": "note", + "message": { + "text": "Package System.Globalization, Version=4.3.0 needs to be deleted." + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "file:///C:/Users/dijkstrab/diagram-generator/CSharpSyntaxWalkerTest/CSharpSyntaxWalkerTest.csproj" + }, + "region": {} + } + } + ] + }, + { + "ruleId": "UA105", + "level": "note", + "message": { + "text": "Package System.IO.Compression, Version=4.3.0 needs to be deleted." + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "file:///C:/Users/dijkstrab/diagram-generator/CSharpSyntaxWalkerTest/CSharpSyntaxWalkerTest.csproj" + }, + "region": {} + } + } + ] + }, + { + "ruleId": "UA105", + "level": "note", + "message": { + "text": "Package System.IO.FileSystem, Version=4.3.0 needs to be deleted." + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "file:///C:/Users/dijkstrab/diagram-generator/CSharpSyntaxWalkerTest/CSharpSyntaxWalkerTest.csproj" + }, + "region": {} + } + } + ] + }, + { + "ruleId": "UA105", + "level": "note", + "message": { + "text": "Package System.IO.FileSystem.Primitives, Version=4.3.0 needs to be deleted." + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "file:///C:/Users/dijkstrab/diagram-generator/CSharpSyntaxWalkerTest/CSharpSyntaxWalkerTest.csproj" + }, + "region": {} + } + } + ] + }, + { + "ruleId": "UA105", + "level": "note", + "message": { + "text": "Package System.Linq, Version=4.3.0 needs to be deleted." + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "file:///C:/Users/dijkstrab/diagram-generator/CSharpSyntaxWalkerTest/CSharpSyntaxWalkerTest.csproj" + }, + "region": {} + } + } + ] + }, + { + "ruleId": "UA105", + "level": "note", + "message": { + "text": "Package System.Linq.Expressions, Version=4.3.0 needs to be deleted." + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "file:///C:/Users/dijkstrab/diagram-generator/CSharpSyntaxWalkerTest/CSharpSyntaxWalkerTest.csproj" + }, + "region": {} + } + } + ] + }, + { + "ruleId": "UA105", + "level": "note", + "message": { + "text": "Package System.Reflection, Version=4.3.0 needs to be deleted." + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "file:///C:/Users/dijkstrab/diagram-generator/CSharpSyntaxWalkerTest/CSharpSyntaxWalkerTest.csproj" + }, + "region": {} + } + } + ] + }, + { + "ruleId": "UA105", + "level": "note", + "message": { + "text": "Package System.Reflection.Metadata, Version=1.4.2 needs to be deleted." + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "file:///C:/Users/dijkstrab/diagram-generator/CSharpSyntaxWalkerTest/CSharpSyntaxWalkerTest.csproj" + }, + "region": {} + } + } + ] + }, + { + "ruleId": "UA105", + "level": "note", + "message": { + "text": "Package System.Resources.ResourceManager, Version=4.3.0 needs to be deleted." + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "file:///C:/Users/dijkstrab/diagram-generator/CSharpSyntaxWalkerTest/CSharpSyntaxWalkerTest.csproj" + }, + "region": {} + } + } + ] + }, + { + "ruleId": "UA105", + "level": "note", + "message": { + "text": "Package System.Runtime, Version=4.3.0 needs to be deleted." + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "file:///C:/Users/dijkstrab/diagram-generator/CSharpSyntaxWalkerTest/CSharpSyntaxWalkerTest.csproj" + }, + "region": {} + } + } + ] + }, + { + "ruleId": "UA105", + "level": "note", + "message": { + "text": "Package System.Runtime.Extensions, Version=4.3.0 needs to be deleted." + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "file:///C:/Users/dijkstrab/diagram-generator/CSharpSyntaxWalkerTest/CSharpSyntaxWalkerTest.csproj" + }, + "region": {} + } + } + ] + }, + { + "ruleId": "UA105", + "level": "note", + "message": { + "text": "Package System.Runtime.InteropServices, Version=4.3.0 needs to be deleted." + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "file:///C:/Users/dijkstrab/diagram-generator/CSharpSyntaxWalkerTest/CSharpSyntaxWalkerTest.csproj" + }, + "region": {} + } + } + ] + }, + { + "ruleId": "UA105", + "level": "note", + "message": { + "text": "Package System.Runtime.Numerics, Version=4.3.0 needs to be deleted." + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "file:///C:/Users/dijkstrab/diagram-generator/CSharpSyntaxWalkerTest/CSharpSyntaxWalkerTest.csproj" + }, + "region": {} + } + } + ] + }, + { + "ruleId": "UA105", + "level": "note", + "message": { + "text": "Package System.Security.Cryptography.Algorithms, Version=4.3.0 needs to be deleted." + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "file:///C:/Users/dijkstrab/diagram-generator/CSharpSyntaxWalkerTest/CSharpSyntaxWalkerTest.csproj" + }, + "region": {} + } + } + ] + }, + { + "ruleId": "UA105", + "level": "note", + "message": { + "text": "Package System.Security.Cryptography.Encoding, Version=4.3.0 needs to be deleted." + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "file:///C:/Users/dijkstrab/diagram-generator/CSharpSyntaxWalkerTest/CSharpSyntaxWalkerTest.csproj" + }, + "region": {} + } + } + ] + }, + { + "ruleId": "UA105", + "level": "note", + "message": { + "text": "Package System.Security.Cryptography.Primitives, Version=4.3.0 needs to be deleted." + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "file:///C:/Users/dijkstrab/diagram-generator/CSharpSyntaxWalkerTest/CSharpSyntaxWalkerTest.csproj" + }, + "region": {} + } + } + ] + }, + { + "ruleId": "UA105", + "level": "note", + "message": { + "text": "Package System.Security.Cryptography.X509Certificates, Version=4.3.0 needs to be deleted." + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "file:///C:/Users/dijkstrab/diagram-generator/CSharpSyntaxWalkerTest/CSharpSyntaxWalkerTest.csproj" + }, + "region": {} + } + } + ] + }, + { + "ruleId": "UA105", + "level": "note", + "message": { + "text": "Package System.Text.Encoding, Version=4.3.0 needs to be deleted." + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "file:///C:/Users/dijkstrab/diagram-generator/CSharpSyntaxWalkerTest/CSharpSyntaxWalkerTest.csproj" + }, + "region": {} + } + } + ] + }, + { + "ruleId": "UA105", + "level": "note", + "message": { + "text": "Package System.Text.Encoding.CodePages, Version=4.3.0 needs to be deleted." + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "file:///C:/Users/dijkstrab/diagram-generator/CSharpSyntaxWalkerTest/CSharpSyntaxWalkerTest.csproj" + }, + "region": {} + } + } + ] + }, + { + "ruleId": "UA105", + "level": "note", + "message": { + "text": "Package System.Text.Encoding.Extensions, Version=4.3.0 needs to be deleted." + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "file:///C:/Users/dijkstrab/diagram-generator/CSharpSyntaxWalkerTest/CSharpSyntaxWalkerTest.csproj" + }, + "region": {} + } + } + ] + }, + { + "ruleId": "UA105", + "level": "note", + "message": { + "text": "Package System.Threading, Version=4.3.0 needs to be deleted." + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "file:///C:/Users/dijkstrab/diagram-generator/CSharpSyntaxWalkerTest/CSharpSyntaxWalkerTest.csproj" + }, + "region": {} + } + } + ] + }, + { + "ruleId": "UA105", + "level": "note", + "message": { + "text": "Package System.Threading.Tasks, Version=4.3.0 needs to be deleted." + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "file:///C:/Users/dijkstrab/diagram-generator/CSharpSyntaxWalkerTest/CSharpSyntaxWalkerTest.csproj" + }, + "region": {} + } + } + ] + }, + { + "ruleId": "UA105", + "level": "note", + "message": { + "text": "Package System.Threading.Tasks.Parallel, Version=4.3.0 needs to be deleted." + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "file:///C:/Users/dijkstrab/diagram-generator/CSharpSyntaxWalkerTest/CSharpSyntaxWalkerTest.csproj" + }, + "region": {} + } + } + ] + }, + { + "ruleId": "UA105", + "level": "note", + "message": { + "text": "Package System.Threading.Thread, Version=4.3.0 needs to be deleted." + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "file:///C:/Users/dijkstrab/diagram-generator/CSharpSyntaxWalkerTest/CSharpSyntaxWalkerTest.csproj" + }, + "region": {} + } + } + ] + }, + { + "ruleId": "UA105", + "level": "note", + "message": { + "text": "Package System.ValueTuple, Version=4.3.0 needs to be deleted." + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "file:///C:/Users/dijkstrab/diagram-generator/CSharpSyntaxWalkerTest/CSharpSyntaxWalkerTest.csproj" + }, + "region": {} + } + } + ] + }, + { + "ruleId": "UA105", + "level": "note", + "message": { + "text": "Package System.Xml.ReaderWriter, Version=4.3.0 needs to be deleted." + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "file:///C:/Users/dijkstrab/diagram-generator/CSharpSyntaxWalkerTest/CSharpSyntaxWalkerTest.csproj" + }, + "region": {} + } + } + ] + }, + { + "ruleId": "UA105", + "level": "note", + "message": { + "text": "Package System.Xml.XDocument, Version=4.3.0 needs to be deleted." + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "file:///C:/Users/dijkstrab/diagram-generator/CSharpSyntaxWalkerTest/CSharpSyntaxWalkerTest.csproj" + }, + "region": {} + } + } + ] + }, + { + "ruleId": "UA105", + "level": "note", + "message": { + "text": "Package System.Xml.XmlDocument, Version=4.3.0 needs to be deleted." + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "file:///C:/Users/dijkstrab/diagram-generator/CSharpSyntaxWalkerTest/CSharpSyntaxWalkerTest.csproj" + }, + "region": {} + } + } + ] + }, + { + "ruleId": "UA105", + "level": "note", + "message": { + "text": "Package System.Xml.XPath, Version=4.3.0 needs to be deleted." + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "file:///C:/Users/dijkstrab/diagram-generator/CSharpSyntaxWalkerTest/CSharpSyntaxWalkerTest.csproj" + }, + "region": {} + } + } + ] + }, + { + "ruleId": "UA105", + "level": "note", + "message": { + "text": "Package System.Xml.XPath.XDocument, Version=4.3.0 needs to be deleted." + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "file:///C:/Users/dijkstrab/diagram-generator/CSharpSyntaxWalkerTest/CSharpSyntaxWalkerTest.csproj" + }, + "region": {} + } + } + ] + }, + { + "ruleId": "UA106", + "level": "note", + "message": { + "text": "Package Microsoft.DotNet.UpgradeAssistant.Extensions.Default.Analyzers, Version=0.4.421302 needs to be added." + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "file:///C:/Users/dijkstrab/diagram-generator/CSharpSyntaxWalkerTest/CSharpSyntaxWalkerTest.csproj" + }, + "region": {} + } + } + ] + } + ], + "columnKind": "utf16CodeUnits" + }, + { + "tool": { + "driver": { + "name": "API Upgradability", + "semanticVersion": "0.4.421302", + "informationUri": "https://docs.microsoft.com/en-us/dotnet/core/porting/upgrade-assistant-overview" + } + }, + "results": [], + "columnKind": "utf16CodeUnits" + }, + { + "tool": { + "driver": { + "name": "Component Analysis", + "semanticVersion": "0.4.421302", + "informationUri": "https://docs.microsoft.com/en-us/dotnet/core/porting/upgrade-assistant-overview", + "rules": [ + { + "id": "UA209", + "name": "Microsoft.DotNet.UpgradeAssistant.Extensions.Windows.WinformsDefaultFontUpdater", + "fullDescription": { + "text": "Default Font API Alert" + } + } + ] + } + }, + "results": [ + { + "ruleId": "UA209", + "level": "note", + "message": { + "text": "Default font in Windows Forms has been changed from Microsoft Sans Serif to Segoe UI, in order to change the default font use the API - Application.SetDefaultFont(Font font). For more details see here - https://devblogs.microsoft.com/dotnet/whats-new-in-windows-forms-in-net-6-0-preview-5/#application-wide-default-font." + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "file:///C:/Users/dijkstrab/diagram-generator/DiagramGeneratorUI/DiagramGeneratorUI.csproj" + }, + "region": {} + } + } + ] + } + ], + "columnKind": "utf16CodeUnits" + } + ] +} \ No newline at end of file diff --git a/CSharpSyntaxWalkerTest/App.config b/CSharpSyntaxWalkerTest/App.config index d4d2ce4..740ed67 100644 --- a/CSharpSyntaxWalkerTest/App.config +++ b/CSharpSyntaxWalkerTest/App.config @@ -1,7 +1,7 @@  - - + + @@ -33,6 +33,14 @@ + + + + + + + + - + \ No newline at end of file diff --git a/CSharpSyntaxWalkerTest/CSharpSyntaxWalkerTest.csproj b/CSharpSyntaxWalkerTest/CSharpSyntaxWalkerTest.csproj index 354ff22..c4bcae5 100644 --- a/CSharpSyntaxWalkerTest/CSharpSyntaxWalkerTest.csproj +++ b/CSharpSyntaxWalkerTest/CSharpSyntaxWalkerTest.csproj @@ -1,156 +1,37 @@ - - - + - Debug - AnyCPU - {95B335A8-37C9-4C51-84C9-72E9C5C0A459} + net7.0 Exe - Properties - CSharpSyntaxWalkerTest - CSharpSyntaxWalkerTest - v4.6 - 512 - true - + false - - AnyCPU - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - - - AnyCPU - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - - - - ..\packages\Microsoft.CodeAnalysis.Common.2.0.0\lib\netstandard1.3\Microsoft.CodeAnalysis.dll - True - - - ..\packages\Microsoft.CodeAnalysis.CSharp.2.0.0\lib\netstandard1.3\Microsoft.CodeAnalysis.CSharp.dll - True - - - - ..\packages\System.AppContext.4.3.0\lib\net46\System.AppContext.dll - True - - - ..\packages\System.Collections.Immutable.1.3.1\lib\portable-net45+win8+wp8+wpa81\System.Collections.Immutable.dll - True - - - - ..\packages\System.Console.4.3.0\lib\net46\System.Console.dll - True - - - - ..\packages\System.Diagnostics.FileVersionInfo.4.3.0\lib\net46\System.Diagnostics.FileVersionInfo.dll - True - - - ..\packages\System.Diagnostics.StackTrace.4.3.0\lib\net46\System.Diagnostics.StackTrace.dll - True - - - ..\packages\System.IO.Compression.4.3.0\lib\net46\System.IO.Compression.dll - True - - - ..\packages\System.IO.FileSystem.4.3.0\lib\net46\System.IO.FileSystem.dll - True - - - ..\packages\System.IO.FileSystem.Primitives.4.3.0\lib\net46\System.IO.FileSystem.Primitives.dll - True - - - - ..\packages\System.Reflection.Metadata.1.4.2\lib\portable-net45+win8\System.Reflection.Metadata.dll - True - - - ..\packages\System.Security.Cryptography.Algorithms.4.3.0\lib\net46\System.Security.Cryptography.Algorithms.dll - True - - - ..\packages\System.Security.Cryptography.Encoding.4.3.0\lib\net46\System.Security.Cryptography.Encoding.dll - True - - - ..\packages\System.Security.Cryptography.Primitives.4.3.0\lib\net46\System.Security.Cryptography.Primitives.dll - True - - - ..\packages\System.Security.Cryptography.X509Certificates.4.3.0\lib\net46\System.Security.Cryptography.X509Certificates.dll - True - - - ..\packages\System.Text.Encoding.CodePages.4.3.0\lib\net46\System.Text.Encoding.CodePages.dll - True - - - ..\packages\System.Threading.Thread.4.3.0\lib\net46\System.Threading.Thread.dll - True - - - ..\packages\System.ValueTuple.4.3.0\lib\netstandard1.0\System.ValueTuple.dll - True - - - - - - - - - ..\packages\System.Xml.ReaderWriter.4.3.0\lib\net46\System.Xml.ReaderWriter.dll - True - - - ..\packages\System.Xml.XmlDocument.4.3.0\lib\net46\System.Xml.XmlDocument.dll - True - - - ..\packages\System.Xml.XPath.4.3.0\lib\net46\System.Xml.XPath.dll - True - - - ..\packages\System.Xml.XPath.XDocument.4.3.0\lib\net46\System.Xml.XPath.XDocument.dll - True - - - - - - - - + + .editorconfig + - - + + + + + + + + + + + + + + + + + + + + + + all + - - \ No newline at end of file diff --git a/CSharpSyntaxWalkerTest/Program.cs b/CSharpSyntaxWalkerTest/Program.cs index cff4b38..992e437 100644 --- a/CSharpSyntaxWalkerTest/Program.cs +++ b/CSharpSyntaxWalkerTest/Program.cs @@ -6,22 +6,9 @@ namespace CSharpSyntaxWalkerTest { - class Program - { - static void Main(string[] args) - { - using (var stream = new FileStream(@"C:\Users\JAH\Documents\Git\xgsos[2]\Kernel\XgsOS.Hardware\XgsOS.Hardware.Factory\HardwareFactory.cs", FileMode.Open, FileAccess.Read)) - { - var tree = (CSharpSyntaxTree)CSharpSyntaxTree.ParseText(SourceText.From(stream)); - new Walker().Visit(tree.GetRoot()); - Console.ReadLine(); - } - } - } - public class Walker : CSharpSyntaxWalker { - static int Tabs = 0; + private static int Tabs = 0; public Walker() : base(SyntaxWalkerDepth.Token) { @@ -30,7 +17,7 @@ public Walker() : base(SyntaxWalkerDepth.Token) public override void Visit(SyntaxNode node) { Tabs++; - var indents = new string('\t', Tabs); + string indents = new string('\t', Tabs); Console.WriteLine(indents + node.Kind()); base.Visit(node); Tabs--; @@ -38,9 +25,22 @@ public override void Visit(SyntaxNode node) public override void VisitToken(SyntaxToken token) { - var indents = new string('\t', Tabs); + string indents = new string('\t', Tabs); Console.WriteLine(indents + token); base.VisitToken(token); } } -} + + internal class Program + { + private static void Main(string[] args) + { + using (FileStream stream = new FileStream(@"C:\Users\JAH\Documents\Git\xgsos[2]\Kernel\XgsOS.Hardware\XgsOS.Hardware.Factory\HardwareFactory.cs", FileMode.Open, FileAccess.Read)) + { + CSharpSyntaxTree tree = (CSharpSyntaxTree)CSharpSyntaxTree.ParseText(SourceText.From(stream)); + new Walker().Visit(tree.GetRoot()); + Console.ReadLine(); + } + } + } +} \ No newline at end of file diff --git a/CSharpSyntaxWalkerTest/Properties/AssemblyInfo.cs b/CSharpSyntaxWalkerTest/Properties/AssemblyInfo.cs index 6965d61..47e6cf0 100644 --- a/CSharpSyntaxWalkerTest/Properties/AssemblyInfo.cs +++ b/CSharpSyntaxWalkerTest/Properties/AssemblyInfo.cs @@ -1,8 +1,7 @@ using System.Reflection; -using System.Runtime.CompilerServices; using System.Runtime.InteropServices; -// General Information about an assembly is controlled through the following +// General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information // associated with an assembly. [assembly: AssemblyTitle("CSharpSyntaxWalkerTest")] @@ -14,8 +13,8 @@ [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from // COM, set the ComVisible attribute to true on that type. [assembly: ComVisible(false)] @@ -25,12 +24,12 @@ // Version information for an assembly consists of the following four values: // // Major Version -// Minor Version +// Minor Version // Build Number // Revision // -// You can specify all the values or you can default the Build and Revision Numbers +// You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] [assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] \ No newline at end of file diff --git a/CSharpSyntaxWalkerTest/packages.config b/CSharpSyntaxWalkerTest/packages.config deleted file mode 100644 index f1e9442..0000000 --- a/CSharpSyntaxWalkerTest/packages.config +++ /dev/null @@ -1,46 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/DiagramGenerator.sln b/DiagramGenerator.sln index 5a221cd..8d57ce7 100644 --- a/DiagramGenerator.sln +++ b/DiagramGenerator.sln @@ -1,7 +1,7 @@  Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 14 -VisualStudioVersion = 14.0.25420.1 +# Visual Studio Version 17 +VisualStudioVersion = 17.5.33530.505 MinimumVisualStudioVersion = 10.0.40219.1 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DiagramGenerator", "DiagramGenerator\DiagramGenerator.csproj", "{9039E5EC-6864-4C23-B6D9-56E13357A262}" EndProject @@ -9,6 +9,11 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DiagramGeneratorUI", "Diagr EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CSharpSyntaxWalkerTest", "CSharpSyntaxWalkerTest\CSharpSyntaxWalkerTest.csproj", "{95B335A8-37C9-4C51-84C9-72E9C5C0A459}" EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{F7BAA3A6-7A9F-426F-8373-539CB94A70C7}" + ProjectSection(SolutionItems) = preProject + .editorconfig = .editorconfig + EndProjectSection +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU diff --git a/DiagramGenerator/CSharpAnalyzer.cs b/DiagramGenerator/CSharpAnalyzer.cs index 273be06..0dfd2ac 100644 --- a/DiagramGenerator/CSharpAnalyzer.cs +++ b/DiagramGenerator/CSharpAnalyzer.cs @@ -1,7 +1,7 @@ -using System; +using Microsoft.CodeAnalysis.CSharp.Syntax; +using System; using System.Collections.Generic; using System.Threading.Tasks; -using Microsoft.CodeAnalysis.CSharp.Syntax; namespace DiagramGenerator { @@ -21,23 +21,23 @@ public async Task AnalyzeFilesAsync(IEnumerable public CSharpObjectCollection AnalyzeFiles(IEnumerable files) { - var visitor = new CSharpVisitor(); - var coll = new CSharpObjectCollection(); + CSharpVisitor visitor = new(); + CSharpObjectCollection coll = new(); // Pass 1 - add all classes and interfaces found in the files. visitor.HandleClass = c => { - var name = c.Identifier.ToString(); + string name = c.Identifier.ToString(); coll.AddClass(name); log?.Invoke($"Class: {name}"); }; visitor.HandleInterface = i => { - var name = i.Identifier.ToString(); + string name = i.Identifier.ToString(); coll.AddInterface(name); log?.Invoke($"Interface: {name}"); }; - foreach (var file in files) + foreach (string file in files) { visitor.Visit(file); } @@ -45,7 +45,7 @@ public CSharpObjectCollection AnalyzeFiles(IEnumerable files) // Pass 2 - handle extension and composition for all classes found in the files. visitor.HandleClass = c => DetermineExtensionAndComposition(c, coll); visitor.HandleInterface = null; - foreach (var file in files) + foreach (string file in files) { visitor.Visit(file); } @@ -53,9 +53,9 @@ public CSharpObjectCollection AnalyzeFiles(IEnumerable files) return coll; } - private CSharpVisibility GetVisibility(FieldDeclarationSyntax field) + private static CSharpVisibility GetVisibility(FieldDeclarationSyntax field) { - foreach (var modifier in field.Modifiers) + foreach (Microsoft.CodeAnalysis.SyntaxToken modifier in field.Modifiers) { if (modifier.Text == "private") { @@ -81,21 +81,21 @@ private void DetermineExtensionAndComposition(ClassDeclarationSyntax c, CSharpOb { if (c.BaseList != null) { - foreach (var baseType in c.BaseList.Types) + foreach (BaseTypeSyntax baseType in c.BaseList.Types) { coll.SetExtends(c.Identifier.ToString(), baseType.Type.ToString()); - log?.Invoke($"{c.Identifier.ToString()} extends {baseType.Type.ToString()}"); + log?.Invoke($"{c.Identifier} extends {baseType.Type}"); } } - foreach (var member in c.Members) + foreach (MemberDeclarationSyntax member in c.Members) { if (member is FieldDeclarationSyntax) { try { - var visibility = GetVisibility(member as FieldDeclarationSyntax); - var field = member as FieldDeclarationSyntax; - var type = field.Declaration.Type; + CSharpVisibility visibility = GetVisibility(member as FieldDeclarationSyntax); + FieldDeclarationSyntax field = member as FieldDeclarationSyntax; + TypeSyntax type = field.Declaration.Type; if (type is IdentifierNameSyntax) { coll.SetAssociation( @@ -103,21 +103,20 @@ private void DetermineExtensionAndComposition(ClassDeclarationSyntax c, CSharpOb (type as IdentifierNameSyntax).Identifier.Text, visibility); log?.Invoke( - $"{c.Identifier.ToString()} associates to {(type as IdentifierNameSyntax).Identifier.Text}"); + $"{c.Identifier} associates to {(type as IdentifierNameSyntax).Identifier.Text}"); } else if (type is GenericNameSyntax) { coll.SetAssociation( - c.Identifier.ToString(), + c.Identifier.ToString(), (type as GenericNameSyntax).Identifier.Text, visibility); - foreach (var arg in (type as GenericNameSyntax).TypeArgumentList.Arguments) + foreach (TypeSyntax arg in (type as GenericNameSyntax).TypeArgumentList.Arguments) { coll.SetAssociation(c.Identifier.ToString(), arg.ToString(), visibility); - log?.Invoke($"{c.Identifier.ToString()} associates to {arg.ToString()}"); + log?.Invoke($"{c.Identifier} associates to {arg}"); } } - } catch (Exception e) { @@ -125,7 +124,6 @@ private void DetermineExtensionAndComposition(ClassDeclarationSyntax c, CSharpOb } } } - } } -} +} \ No newline at end of file diff --git a/DiagramGenerator/CSharpObjects.cs b/DiagramGenerator/CSharpObjects.cs index 07aa88f..c05aceb 100644 --- a/DiagramGenerator/CSharpObjects.cs +++ b/DiagramGenerator/CSharpObjects.cs @@ -25,7 +25,7 @@ public void Clone(CSharpObjectCollection coll) } } - [Serializable()] + [Serializable()] public class InterfaceAssociation { public CSharpInterface Interface { get; set; } @@ -35,10 +35,9 @@ public class InterfaceAssociation [Serializable()] public class CSharpClass : CSharpInterface { - public CSharpClass Derives { get; internal set; } - public IEnumerable Implements => implements; - public IEnumerable InterfaceAssociations => interfaceAssociations; - public IEnumerable ClassAssociations => classAssociations; + private readonly List implements; + private readonly List interfaceAssociations; + private readonly List classAssociations; public CSharpClass() { @@ -47,48 +46,10 @@ public CSharpClass() classAssociations = new List(); } - private readonly List implements; - private readonly List interfaceAssociations; - private readonly List classAssociations; - - internal void ExtendsInterface(CSharpInterface i) - { - implements.Add(i); - } - - internal void AddInterfaceAssociation(CSharpInterface i, CSharpVisibility visibility) - { - var ia = interfaceAssociations.FirstOrDefault(a => a.Interface == i); - if (ia == null) - { - interfaceAssociations.Add(new InterfaceAssociation - { - Interface = i, - Visibility = visibility - }); - } - else if (ia.Visibility < visibility) - { - ia.Visibility = visibility; - } - } - - internal void AddClassAssociation(CSharpClass c, CSharpVisibility visibility) - { - var ca = classAssociations.FirstOrDefault(a => a.Class == c); - if (ca == null) - { - classAssociations.Add(new ClassAssociation - { - Class = c, - Visibility = visibility - }); - } - else if (ca.Visibility < visibility) - { - ca.Visibility = visibility; - } - } + public CSharpClass Derives { get; internal set; } + public IEnumerable Implements => implements; + public IEnumerable InterfaceAssociations => interfaceAssociations; + public IEnumerable ClassAssociations => classAssociations; public void Clone(CSharpObjectCollection coll, Settings settings, int depth) { @@ -96,7 +57,7 @@ public void Clone(CSharpObjectCollection coll, Settings settings, int depth) if (depth > 0) { - foreach (var c in ClassAssociations) + foreach (ClassAssociation c in ClassAssociations) { if ( (c.Visibility == CSharpVisibility.Public && settings.IncludePublicAssociations) || @@ -113,7 +74,7 @@ public void Clone(CSharpObjectCollection coll, Settings settings, int depth) } } - foreach (var i in InterfaceAssociations) + foreach (InterfaceAssociation i in InterfaceAssociations) { if ( (i.Visibility == CSharpVisibility.Public && settings.IncludePublicAssociations) || @@ -132,7 +93,7 @@ public void Clone(CSharpObjectCollection coll, Settings settings, int depth) if (settings.IncludeInheritance) { - foreach (var i in Implements) + foreach (CSharpInterface i in Implements) { if (!coll.InterfaceExists(i.Name)) { @@ -144,12 +105,50 @@ public void Clone(CSharpObjectCollection coll, Settings settings, int depth) { if (!coll.ClassExists(Derives.Name)) { - Derives.Clone(coll, settings, depth-1); + Derives.Clone(coll, settings, depth - 1); } coll.SetExtends(Name, Derives.Name); } } + } + } + + internal void ExtendsInterface(CSharpInterface i) + { + implements.Add(i); + } + internal void AddInterfaceAssociation(CSharpInterface i, CSharpVisibility visibility) + { + InterfaceAssociation ia = interfaceAssociations.FirstOrDefault(a => a.Interface == i); + if (ia == null) + { + interfaceAssociations.Add(new InterfaceAssociation + { + Interface = i, + Visibility = visibility + }); + } + else if (ia.Visibility < visibility) + { + ia.Visibility = visibility; + } + } + + internal void AddClassAssociation(CSharpClass c, CSharpVisibility visibility) + { + ClassAssociation ca = classAssociations.FirstOrDefault(a => a.Class == c); + if (ca == null) + { + classAssociations.Add(new ClassAssociation + { + Class = c, + Visibility = visibility + }); + } + else if (ca.Visibility < visibility) + { + ca.Visibility = visibility; } } } @@ -164,11 +163,8 @@ public class ClassAssociation [Serializable()] public class CSharpObjectCollection { - public IEnumerable Classes => classes; - public IEnumerable Interfaces => interfaces; - - private List classes; - private List interfaces; + private readonly List classes; + private readonly List interfaces; public CSharpObjectCollection() { @@ -176,6 +172,21 @@ public CSharpObjectCollection() interfaces = new List(); } + public IEnumerable Classes => classes; + public IEnumerable Interfaces => interfaces; + + public static CSharpObjectCollection Deserialize(string fileName) + { + //var coll = new CSharpObjectCollection(); + Stream s = File.OpenRead(fileName); + BinaryFormatter serializer = new(); +#pragma warning disable SYSLIB0011 // Type or member is obsolete + object coll = serializer.Deserialize(s); +#pragma warning restore SYSLIB0011 // Type or member is obsolete + s.Close(); + return coll as CSharpObjectCollection; + } + public bool ClassExists(string name) { return classes.FirstOrDefault(c => c.Name == name) != null; @@ -204,9 +215,9 @@ public void AddInterface(string name) public void SetExtends(string className, string extends) { - var thisClass = classes.FirstOrDefault(c => c.Name == className); - var extendedClass = classes.FirstOrDefault(c => c.Name == extends); - var extendedInterface = interfaces.FirstOrDefault(i => i.Name == extends); + CSharpClass thisClass = classes.FirstOrDefault(c => c.Name == className); + CSharpClass extendedClass = classes.FirstOrDefault(c => c.Name == extends); + CSharpInterface extendedInterface = interfaces.FirstOrDefault(i => i.Name == extends); if (thisClass != null) { @@ -223,9 +234,9 @@ public void SetExtends(string className, string extends) public void SetAssociation(string className, string associatesTo, CSharpVisibility visibility) { - var thisClass = classes.FirstOrDefault(c => c.Name == className); - var associatedClass = classes.FirstOrDefault(c => c.Name == associatesTo); - var associatedInterface = interfaces.FirstOrDefault(i => i.Name == associatesTo); + CSharpClass thisClass = classes.FirstOrDefault(c => c.Name == className); + CSharpClass associatedClass = classes.FirstOrDefault(c => c.Name == associatesTo); + CSharpInterface associatedInterface = interfaces.FirstOrDefault(i => i.Name == associatesTo); if (thisClass != null) { @@ -242,7 +253,7 @@ public void SetAssociation(string className, string associatesTo, CSharpVisibili public CSharpObjectCollection Clone(string startClass, Settings settings, int depth) { - var coll = new CSharpObjectCollection(); + CSharpObjectCollection coll = new(); classes.FirstOrDefault(c => c.Name == startClass)?.Clone(coll, settings, depth); return coll; } @@ -250,19 +261,11 @@ public CSharpObjectCollection Clone(string startClass, Settings settings, int de public void Serialize(string fileName) { Stream s = File.Create(fileName); - var serializer = new BinaryFormatter(); + BinaryFormatter serializer = new(); +#pragma warning disable SYSLIB0011 // Type or member is obsolete serializer.Serialize(s, this); +#pragma warning restore SYSLIB0011 // Type or member is obsolete s.Close(); } - - public static CSharpObjectCollection Deserialize(string fileName) - { - //var coll = new CSharpObjectCollection(); - Stream s = File.OpenRead(fileName); - var serializer = new BinaryFormatter(); - var coll = serializer.Deserialize(s); - s.Close(); - return coll as CSharpObjectCollection; - } } -} +} \ No newline at end of file diff --git a/DiagramGenerator/CSharpVisitor.cs b/DiagramGenerator/CSharpVisitor.cs index 9b26b87..46f46c5 100644 --- a/DiagramGenerator/CSharpVisitor.cs +++ b/DiagramGenerator/CSharpVisitor.cs @@ -1,61 +1,62 @@ -using System; -using System.IO; using Microsoft.CodeAnalysis; using Microsoft.CodeAnalysis.CSharp; using Microsoft.CodeAnalysis.CSharp.Syntax; using Microsoft.CodeAnalysis.Text; +using System; +using System.IO; -public class CSharpVisitor +namespace DiagramGenerator { - private class Walker : CSharpSyntaxWalker - { - public Action handleClass; - public Action handleInterface; + public class CSharpVisitor + { + private readonly Walker walker; - public override void Visit(SyntaxNode node) + public CSharpVisitor() { - if (node is ClassDeclarationSyntax) - { - handleClass?.Invoke((ClassDeclarationSyntax)node); - } - if (node is InterfaceDeclarationSyntax) - { - handleInterface?.Invoke((InterfaceDeclarationSyntax)node); - } - base.Visit(node); + walker = new Walker(); } - } - private Walker walker; - - public Action HandleClass - { - get { return walker.handleClass; } - set { walker.handleClass = value; } - } - - public Action HandleInterface - { - get { return walker.handleInterface; } - set { walker.handleInterface = value; } - } + public Action HandleClass + { + get { return walker.handleClass; } + set { walker.handleClass = value; } + } - public CSharpVisitor() - { - walker = new Walker(); - } + public Action HandleInterface + { + get { return walker.handleInterface; } + set { walker.handleInterface = value; } + } - public void Visit(CSharpSyntaxTree tree) - { - walker.Visit(tree.GetRoot()); - } + public void Visit(CSharpSyntaxTree tree) + { + walker.Visit(tree.GetRoot()); + } - public void Visit(string fileName) - { - using (var stream = new FileStream(fileName, FileMode.Open, FileAccess.Read)) + public void Visit(string fileName) { - var tree = (CSharpSyntaxTree)CSharpSyntaxTree.ParseText(SourceText.From(stream)); + using FileStream stream = new(fileName, FileMode.Open, FileAccess.Read); + CSharpSyntaxTree tree = (CSharpSyntaxTree)CSharpSyntaxTree.ParseText(SourceText.From(stream)); Visit(tree); } + + private class Walker : CSharpSyntaxWalker + { + public Action handleClass; + public Action handleInterface; + + public override void Visit(SyntaxNode node) + { + if (node is ClassDeclarationSyntax syntax) + { + handleClass?.Invoke(syntax); + } + if (node is InterfaceDeclarationSyntax syntax1) + { + handleInterface?.Invoke(syntax1); + } + base.Visit(node); + } + } } } \ No newline at end of file diff --git a/DiagramGenerator/ConfigFile.cs b/DiagramGenerator/ConfigFile.cs index 5317671..cdf47bf 100644 --- a/DiagramGenerator/ConfigFile.cs +++ b/DiagramGenerator/ConfigFile.cs @@ -1,6 +1,6 @@ using System; -using System.IO; using System.Collections.Generic; +using System.IO; namespace DiagramGenerator { @@ -10,28 +10,18 @@ public class ConfigFile public ConfigFile(string path) { - var lines = File.ReadAllLines(path); + string[] lines = File.ReadAllLines(path); values = new Dictionary(); - foreach (var line in lines) + foreach (string line in lines) { - var eqPos = line.IndexOf("="); + int eqPos = line.IndexOf("="); if (eqPos > 0) { - values.Add(line.Substring(0, eqPos).Trim(), line.Substring(eqPos+1).Trim()); + values.Add(line[..eqPos].Trim(), line[(eqPos + 1)..].Trim()); } } } - private T Read(string key, Func converter, T def) - { - string s; - if (!values.TryGetValue(key, out s)) - { - return def; - } - return converter(s); - } - public string ReadString(string key, string def = "") { return Read(key, s => s, def); @@ -39,8 +29,16 @@ public string ReadString(string key, string def = "") public bool ReadBool(string key, bool def = false) { - return Read(key, s => s.ToLower() == "1" || s.ToLower() == "t" || s.ToLower() == "true", def); + return Read(key, s => s.ToLower() == "1" || s.ToLower() == "t" || s.ToLower() == "true", def); } + private T Read(string key, Func converter, T def) + { + if (!values.TryGetValue(key, out string s)) + { + return def; + } + return converter(s); + } } -} +} \ No newline at end of file diff --git a/DiagramGenerator/DiagramGenerator.csproj b/DiagramGenerator/DiagramGenerator.csproj index 4040f42..83991bd 100644 --- a/DiagramGenerator/DiagramGenerator.csproj +++ b/DiagramGenerator/DiagramGenerator.csproj @@ -1,86 +1,21 @@ - - - + - Debug - AnyCPU - {9039E5EC-6864-4C23-B6D9-56E13357A262} + net7.0 Exe - Properties - DiagramGenerator - DiagramGenerator - v4.6 - 512 - - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 + false - - ..\packages\Microsoft.CodeAnalysis.Common.1.3.2\lib\net45\Microsoft.CodeAnalysis.dll - True - - - ..\packages\Microsoft.CodeAnalysis.CSharp.1.3.2\lib\net45\Microsoft.CodeAnalysis.CSharp.dll - True - - - - ..\packages\System.Collections.Immutable.1.1.37\lib\dotnet\System.Collections.Immutable.dll - True - - - - ..\packages\System.Reflection.Metadata.1.2.0\lib\portable-net45+win8\System.Reflection.Metadata.dll - True - - - - - - - - - - - - - - - - - - - - + + + + + all + - - + - - \ No newline at end of file diff --git a/DiagramGenerator/Program.cs b/DiagramGenerator/Program.cs index 26e9a6f..46398c2 100644 --- a/DiagramGenerator/Program.cs +++ b/DiagramGenerator/Program.cs @@ -1,6 +1,6 @@ using System; -using System.IO; using System.Collections.Generic; +using System.IO; using System.Linq; namespace DiagramGenerator @@ -8,21 +8,9 @@ namespace DiagramGenerator public class Program { private static CSharpAnalyzer Analyzer; - private static UmlGenerator Generator; private static CSharpObjectCollection Collection; private static Settings Settings; - private static void SaveFile(List uml, string fileName) - { - using (TextWriter tw = new StreamWriter(fileName)) - { - foreach (String s in uml) - { - tw.WriteLine(s); - } - } - } - public static void Main(string[] args) { string dir; @@ -38,22 +26,30 @@ public static void Main(string[] args) } Analyzer = new CSharpAnalyzer(Console.WriteLine); - Generator = new UmlGenerator(); - var files = Directory.EnumerateFiles(Path.GetFullPath(dir), "*.cs", SearchOption.AllDirectories); + IEnumerable files = Directory.EnumerateFiles(Path.GetFullPath(dir), "*.cs", SearchOption.AllDirectories); Collection = Analyzer.AnalyzeFiles(files); - var settingsFiles = Directory.EnumerateFiles(Path.GetFullPath(dir), "*.dg.cfg", SearchOption.AllDirectories).ToList(); + List settingsFiles = Directory.EnumerateFiles(Path.GetFullPath(dir), "*.dg.cfg", SearchOption.AllDirectories).ToList(); if (settingsFiles.Count == 0) { settingsFiles.Add(dir + @"\default.dg.cfg"); } - foreach (var settingsFile in settingsFiles) + foreach (string settingsFile in settingsFiles) { Settings = new Settings(settingsFile); - var coll = Settings.StartClass == "" ? Collection : Collection.Clone(Settings.StartClass, Settings, Int32.MaxValue); - SaveFile(Generator.GeneratePlantUml(coll), settingsFile.Replace(".dg.cfg", ".plantuml")); + CSharpObjectCollection coll = Settings.StartClass == "" ? Collection : Collection.Clone(Settings.StartClass, Settings, int.MaxValue); + SaveFile(UmlGenerator.GeneratePlantUml(coll), settingsFile.Replace(".dg.cfg", ".plantuml")); + } + } + + private static void SaveFile(List uml, string fileName) + { + using TextWriter tw = new StreamWriter(fileName); + foreach (string s in uml) + { + tw.WriteLine(s); } } } -} +} \ No newline at end of file diff --git a/DiagramGenerator/Properties/AssemblyInfo.cs b/DiagramGenerator/Properties/AssemblyInfo.cs index b73d823..5252b70 100644 --- a/DiagramGenerator/Properties/AssemblyInfo.cs +++ b/DiagramGenerator/Properties/AssemblyInfo.cs @@ -1,8 +1,7 @@ using System.Reflection; -using System.Runtime.CompilerServices; using System.Runtime.InteropServices; -// General Information about an assembly is controlled through the following +// General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information // associated with an assembly. [assembly: AssemblyTitle("DiagramGenerator")] @@ -14,8 +13,8 @@ [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from // COM, set the ComVisible attribute to true on that type. [assembly: ComVisible(false)] @@ -25,12 +24,12 @@ // Version information for an assembly consists of the following four values: // // Major Version -// Minor Version +// Minor Version // Build Number // Revision // -// You can specify all the values or you can default the Build and Revision Numbers +// You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] [assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] \ No newline at end of file diff --git a/DiagramGenerator/Settings.cs b/DiagramGenerator/Settings.cs index 6a22bbe..f5e1b12 100644 --- a/DiagramGenerator/Settings.cs +++ b/DiagramGenerator/Settings.cs @@ -4,13 +4,6 @@ namespace DiagramGenerator { public class Settings { - public bool IncludePublicAssociations { get; set; } - public bool IncludeProtectedAssociations { get; set; } - public bool IncludeInternalAssociations { get; set; } - public bool IncludePrivateAssociations { get; set; } - public bool IncludeInheritance { get; set; } - public string StartClass { get; set; } - public Settings(string settingsFile = "") { IncludePublicAssociations = true; @@ -21,7 +14,7 @@ public Settings(string settingsFile = "") StartClass = ""; if (File.Exists(settingsFile)) { - var f = new ConfigFile(settingsFile); + ConfigFile f = new(settingsFile); IncludePublicAssociations = f.ReadBool("include_public_associations", IncludePublicAssociations); IncludeProtectedAssociations = f.ReadBool("include_protected_associations", IncludeProtectedAssociations); IncludeInternalAssociations = f.ReadBool("include_internal_associations", IncludeInternalAssociations); @@ -30,6 +23,12 @@ public Settings(string settingsFile = "") StartClass = f.ReadString("start_class", StartClass); } } - } -} + public bool IncludePublicAssociations { get; set; } + public bool IncludeProtectedAssociations { get; set; } + public bool IncludeInternalAssociations { get; set; } + public bool IncludePrivateAssociations { get; set; } + public bool IncludeInheritance { get; set; } + public string StartClass { get; set; } + } +} \ No newline at end of file diff --git a/DiagramGenerator/UmlGenerator.cs b/DiagramGenerator/UmlGenerator.cs index 1f185ef..b8a0230 100644 --- a/DiagramGenerator/UmlGenerator.cs +++ b/DiagramGenerator/UmlGenerator.cs @@ -2,34 +2,36 @@ namespace DiagramGenerator { - public class UmlGenerator + public static class UmlGenerator { - public List GeneratePlantUml(CSharpObjectCollection coll) + public static List GeneratePlantUml(CSharpObjectCollection coll) { - var uml = new List(); + List uml = new() + { + "@startuml" + }; - uml.Add("@startuml"); - foreach (var i in coll.Interfaces) + foreach (CSharpInterface i in coll.Interfaces) { uml.Add($"interface {i.Name}"); } - foreach (var cls in coll.Classes) + foreach (CSharpClass cls in coll.Classes) { uml.Add($"class {cls.Name}"); if (cls.Derives != null) { uml.Add($"{cls.Derives.Name} <|-- {cls.Name}"); } - foreach (var i in cls.Implements) + foreach (CSharpInterface i in cls.Implements) { uml.Add($"{i.Name} <|-- {cls.Name}"); } - foreach (var ia in cls.InterfaceAssociations) + foreach (InterfaceAssociation ia in cls.InterfaceAssociations) { uml.Add($"{ia.Interface.Name} <-- {cls.Name}"); } - foreach (var ca in cls.ClassAssociations) + foreach (ClassAssociation ca in cls.ClassAssociations) { uml.Add($"{ca.Class.Name} <-- {cls.Name}"); } @@ -38,6 +40,5 @@ public List GeneratePlantUml(CSharpObjectCollection coll) return uml; } - } -} +} \ No newline at end of file diff --git a/DiagramGenerator/app.config b/DiagramGenerator/app.config new file mode 100644 index 0000000..f77f5c0 --- /dev/null +++ b/DiagramGenerator/app.config @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/DiagramGenerator/packages.config b/DiagramGenerator/packages.config deleted file mode 100644 index 981979d..0000000 --- a/DiagramGenerator/packages.config +++ /dev/null @@ -1,16 +0,0 @@ - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/DiagramGeneratorUI/App.config b/DiagramGeneratorUI/App.config index e7158d3..5ede787 100644 --- a/DiagramGeneratorUI/App.config +++ b/DiagramGeneratorUI/App.config @@ -1,12 +1,12 @@ - +
- - + + @@ -42,4 +42,4 @@ - + \ No newline at end of file diff --git a/DiagramGeneratorUI/App.xaml b/DiagramGeneratorUI/App.xaml index c2cf294..d7548d0 100644 --- a/DiagramGeneratorUI/App.xaml +++ b/DiagramGeneratorUI/App.xaml @@ -1,9 +1,7 @@  - - + \ No newline at end of file diff --git a/DiagramGeneratorUI/App.xaml.cs b/DiagramGeneratorUI/App.xaml.cs index 9d6cb70..1434bbd 100644 --- a/DiagramGeneratorUI/App.xaml.cs +++ b/DiagramGeneratorUI/App.xaml.cs @@ -1,10 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Configuration; -using System.Data; -using System.Linq; -using System.Threading.Tasks; -using System.Windows; +using System.Windows; namespace DiagramGeneratorUI { @@ -14,4 +8,4 @@ namespace DiagramGeneratorUI public partial class App : Application { } -} +} \ No newline at end of file diff --git a/DiagramGeneratorUI/DiagramGeneratorUI.csproj b/DiagramGeneratorUI/DiagramGeneratorUI.csproj index 5d04cf8..5fa744c 100644 --- a/DiagramGeneratorUI/DiagramGeneratorUI.csproj +++ b/DiagramGeneratorUI/DiagramGeneratorUI.csproj @@ -1,114 +1,24 @@ - - - + - Debug - AnyCPU - {E95E8944-9EA5-408E-9D5E-F5E9CB51B433} + net7.0-windows WinExe - Properties - DiagramGeneratorUI - DiagramGeneratorUI - v4.6 - 512 - {60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - 4 - true - + false + true + true + true - - AnyCPU - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - - - AnyCPU - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - - - - - - - - - - - - - 4.0 - - - - - - - - MSBuild:Compile - Designer - - - MSBuild:Compile - Designer - - - App.xaml - Code - - - MainWindow.xaml - Code - - - - Code - - - True - True - Resources.resx - - - True - Settings.settings - True - - - ResXFileCodeGenerator - Resources.Designer.cs - - - SettingsSingleFileGenerator - Settings.Designer.cs - - + - - {9039e5ec-6864-4c23-b6d9-56e13357a262} - DiagramGenerator - + + + + all + + - - \ No newline at end of file diff --git a/DiagramGeneratorUI/MainWindow.xaml b/DiagramGeneratorUI/MainWindow.xaml index 4af16e8..ee5e0d8 100644 --- a/DiagramGeneratorUI/MainWindow.xaml +++ b/DiagramGeneratorUI/MainWindow.xaml @@ -6,42 +6,42 @@ mc:Ignorable="d" Title="MainWindow" Height="350" Width="516" Closing="Window_Closing"> -