diff --git a/.editorconfig b/.editorconfig index c04e2c7a4..1585b9016 100644 --- a/.editorconfig +++ b/.editorconfig @@ -130,7 +130,7 @@ dotnet_diagnostic.RCS1124.severity = none dotnet_diagnostic.RCS1077.severity = none # IDE0040: Add accessibility modifiers -dotnet_style_require_accessibility_modifiers = always:warning +dotnet_style_require_accessibility_modifiers = for_non_interface_members:warning # IDE0048: Add parentheses for clarity dotnet_style_parentheses_in_relational_binary_operators = always_for_clarity:none diff --git a/.github/upgrades/dotnet-upgrade-plan.md b/.github/upgrades/dotnet-upgrade-plan.md new file mode 100644 index 000000000..4bfc87cb9 --- /dev/null +++ b/.github/upgrades/dotnet-upgrade-plan.md @@ -0,0 +1,34 @@ +# .NET 10 Upgrade Plan + +## Execution Steps + +Execute steps below sequentially one by one in the order they are listed. + +1. Validate that a .NET 10.0 SDK required for this upgrade is installed on the machine and if not, help to get it installed. +2. Ensure that the SDK version specified in global.json files is compatible with the .NET 10.0 upgrade. +3. Upgrade CSharpNetStandardLib/CSharpNetStandardLib.csproj +4. Upgrade ConsoleApp2/CSharpConsoleApp.csproj +5. Upgrade ConsoleApp1/VisualBasicConsoleApp.vbproj + +## Settings + +### Project upgrade details + +#### CSharpNetStandardLib/CSharpNetStandardLib.csproj modifications + +Project properties changes: + - Target framework should be changed from `netstandard2.0` to `net10.0` + +#### ConsoleApp2/CSharpConsoleApp.csproj modifications + +Project file needs to be converted to SDK-style format. + +Project properties changes: + - Target framework should be changed from `.NETFramework,Version=v4.8` to `net10.0` + +#### ConsoleApp1/VisualBasicConsoleApp.vbproj modifications + +Project file needs to be converted to SDK-style format. + +Project properties changes: + - Target framework should be changed from `.NETFramework,Version=v4.8` to `net10.0` diff --git a/.vscode/launch.json b/.vscode/launch.json new file mode 100644 index 000000000..4df0114a7 --- /dev/null +++ b/.vscode/launch.json @@ -0,0 +1,35 @@ +{ + "version": "0.2.0", + "configurations": [ + { + // Use IntelliSense to find out which attributes exist for C# debugging + // Use hover for the description of the existing attributes + // For further information visit https://github.com/dotnet/vscode-csharp/blob/main/debugger-launchjson.md. + "name": ".NET Core Launch (web)", + "type": "coreclr", + "request": "launch", + "preLaunchTask": "build", + // If you have changed target frameworks, make sure to update the program path. + "program": "${workspaceFolder}/Web/bin/Debug/ICSharpCode.CodeConverter.Web.dll", + "args": [], + "cwd": "${workspaceFolder}/Web", + "stopAtEntry": false, + // Enable launching a web browser when ASP.NET Core starts. For more information: https://aka.ms/VSCode-CS-LaunchJson-WebBrowser + "serverReadyAction": { + "action": "openExternally", + "pattern": "\\bNow listening on:\\s+(https?://\\S+)" + }, + "env": { + "ASPNETCORE_ENVIRONMENT": "Development" + }, + "sourceFileMap": { + "/Views": "${workspaceFolder}/Views" + } + }, + { + "name": ".NET Core Attach", + "type": "coreclr", + "request": "attach" + } + ] +} \ No newline at end of file diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 000000000..b5041f4db --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,5 @@ +{ + "dotnet.preferCSharpExtension": true, + "dotnet.defaultSolution": "CodeConverter.sln", + "vscode-as-git-mergetool.settingsAssistantOnStartup": false +} \ No newline at end of file diff --git a/.vscode/tasks.json b/.vscode/tasks.json new file mode 100644 index 000000000..445a84fd5 --- /dev/null +++ b/.vscode/tasks.json @@ -0,0 +1,41 @@ +{ + "version": "2.0.0", + "tasks": [ + { + "label": "build", + "command": "dotnet", + "type": "process", + "args": [ + "build", + "${workspaceFolder}/CodeConverter.sln", + "/property:GenerateFullPaths=true", + "/consoleloggerparameters:NoSummary;ForceNoAlign" + ], + "problemMatcher": "$msCompile" + }, + { + "label": "publish", + "command": "dotnet", + "type": "process", + "args": [ + "publish", + "${workspaceFolder}/CodeConverter.sln", + "/property:GenerateFullPaths=true", + "/consoleloggerparameters:NoSummary;ForceNoAlign" + ], + "problemMatcher": "$msCompile" + }, + { + "label": "watch", + "command": "dotnet", + "type": "process", + "args": [ + "watch", + "run", + "--project", + "${workspaceFolder}/CodeConverter.sln" + ], + "problemMatcher": "$msCompile" + } + ] +} \ No newline at end of file diff --git a/CodeConverter.sln b/CodeConverter.sln index 3c9845cd3..9cf8e128c 100644 --- a/CodeConverter.sln +++ b/CodeConverter.sln @@ -1,7 +1,7 @@  Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio Version 17 -VisualStudioVersion = 17.1.31911.260 +# Visual Studio Version 18 +VisualStudioVersion = 18.0.11205.157 d18.0 MinimumVisualStudioVersion = 10.0.40219.1 Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CodeConverter", "CodeConverter\CodeConverter.csproj", "{7EA075C6-6406-445C-AB77-6C47AFF88D58}" EndProject @@ -26,12 +26,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "CommandLine", "CommandLine" CommandLine\README.md = CommandLine\README.md EndProjectSection EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CodeConv.NetFramework", "CommandLine\CodeConv.NetFramework\CodeConv.NetFramework.csproj", "{CF18CBCF-67FF-46CA-8D1D-3221B7706D7D}" -EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CodeConv", "CommandLine\CodeConv\CodeConv.csproj", "{160F0B34-0F6F-4532-8D7B-39064956364D}" - ProjectSection(ProjectDependencies) = postProject - {CF18CBCF-67FF-46CA-8D1D-3221B7706D7D} = {CF18CBCF-67FF-46CA-8D1D-3221B7706D7D} - EndProjectSection EndProject Project("{D954291E-2A0B-460D-934E-DC6B0785DB48}") = "CodeConv.Shared", "CommandLine\CodeConv.Shared\CodeConv.Shared.shproj", "{D3A957FF-DAFC-4265-9AE2-D94F6473411A}" EndProject @@ -59,10 +54,6 @@ Global {08A20D4F-6310-43BB-B339-6317ACF3B52E}.Debug|Any CPU.Build.0 = Debug|Any CPU {08A20D4F-6310-43BB-B339-6317ACF3B52E}.Release|Any CPU.ActiveCfg = Release|Any CPU {08A20D4F-6310-43BB-B339-6317ACF3B52E}.Release|Any CPU.Build.0 = Release|Any CPU - {CF18CBCF-67FF-46CA-8D1D-3221B7706D7D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {CF18CBCF-67FF-46CA-8D1D-3221B7706D7D}.Debug|Any CPU.Build.0 = Debug|Any CPU - {CF18CBCF-67FF-46CA-8D1D-3221B7706D7D}.Release|Any CPU.ActiveCfg = Release|Any CPU - {CF18CBCF-67FF-46CA-8D1D-3221B7706D7D}.Release|Any CPU.Build.0 = Release|Any CPU {160F0B34-0F6F-4532-8D7B-39064956364D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {160F0B34-0F6F-4532-8D7B-39064956364D}.Debug|Any CPU.Build.0 = Debug|Any CPU {160F0B34-0F6F-4532-8D7B-39064956364D}.Release|Any CPU.ActiveCfg = Release|Any CPU @@ -76,7 +67,6 @@ Global HideSolutionNode = FALSE EndGlobalSection GlobalSection(NestedProjects) = preSolution - {CF18CBCF-67FF-46CA-8D1D-3221B7706D7D} = {926D43FE-D6AE-45E7-A933-8A0F866E7876} {160F0B34-0F6F-4532-8D7B-39064956364D} = {926D43FE-D6AE-45E7-A933-8A0F866E7876} {D3A957FF-DAFC-4265-9AE2-D94F6473411A} = {926D43FE-D6AE-45E7-A933-8A0F866E7876} EndGlobalSection @@ -85,7 +75,6 @@ Global EndGlobalSection GlobalSection(SharedMSBuildProjectFiles) = preSolution CommandLine\CodeConv.Shared\CodeConv.Shared.projitems*{160f0b34-0f6f-4532-8d7b-39064956364d}*SharedItemsImports = 5 - CommandLine\CodeConv.Shared\CodeConv.Shared.projitems*{cf18cbcf-67ff-46ca-8d1d-3221b7706d7d}*SharedItemsImports = 5 CommandLine\CodeConv.Shared\CodeConv.Shared.projitems*{d3a957ff-dafc-4265-9ae2-d94f6473411a}*SharedItemsImports = 13 EndGlobalSection EndGlobal diff --git a/CodeConverter/CSharp/ArgumentConverter.cs b/CodeConverter/CSharp/ArgumentConverter.cs index ac9e8f0e0..41db921f6 100644 --- a/CodeConverter/CSharp/ArgumentConverter.cs +++ b/CodeConverter/CSharp/ArgumentConverter.cs @@ -32,7 +32,7 @@ public async Task ConvertSimpleArgumentAsync(VBSyntax.SimpleAr var baseSymbol = symbol?.OriginalDefinition.GetBaseSymbol(); var possibleParameters = (CommonConversions.GetCsOriginalSymbolOrNull(baseSymbol) ?? symbol)?.GetParameters(); if (possibleParameters.HasValue) { - var refType = _semanticModel.GetRefConversionType(node, argList, possibleParameters.Value, out var argName, out var refKind); + var refType = CommonConversions.GetRefConversionType(node, argList, possibleParameters.Value, out var argName, out var refKind); token = CommonConversions.GetRefToken(refKind); if (refType != SemanticModelExtensions.RefConversion.Inline) { convertedArgExpression = HoistByRefDeclaration(node, convertedArgExpression, refType, argName, refKind); @@ -147,7 +147,10 @@ private CSSyntax.ExpressionSyntax HoistByRefDeclaration(VBSyntax.SimpleArgumentS private ISymbol GetInvocationSymbol(SyntaxNode invocation) { var symbol = invocation.TypeSwitch( - (VBSyntax.InvocationExpressionSyntax e) => _semanticModel.GetSymbolInfo(e).ExtractBestMatch(), + (VBSyntax.InvocationExpressionSyntax e) => _semanticModel.GetSymbolInfo(e).CandidateSymbols + .OrderByDescending(s => s.GetParameters().Length == e.ArgumentList.Arguments.Count) + .ThenByDescending(s => ParameterMatchScore(s, e.ArgumentList.Arguments)) + .FirstOrDefault(), (VBSyntax.ObjectCreationExpressionSyntax e) => _semanticModel.GetSymbolInfo(e).ExtractBestMatch(), (VBSyntax.RaiseEventStatementSyntax e) => _semanticModel.GetSymbolInfo(e.Name).ExtractBestMatch(), (VBSyntax.MidExpressionSyntax _) => CommonConversions.KnownTypes.VbCompilerStringType?.GetMembers("MidStmtStr").FirstOrDefault(), @@ -155,6 +158,12 @@ private ISymbol GetInvocationSymbol(SyntaxNode invocation) return symbol; } + private static int ParameterMatchScore(ISymbol symbol, SeparatedSyntaxList arguments) + { + //TODO: Match on name/position and type + return 1; + } + private IEnumerable GetAdditionalRequiredArgs( IEnumerable arguments, ISymbol invocationSymbol) diff --git a/CodeConverter/CSharp/CommonConversions.cs b/CodeConverter/CSharp/CommonConversions.cs index 60b10caa5..f56e3fce4 100644 --- a/CodeConverter/CSharp/CommonConversions.cs +++ b/CodeConverter/CSharp/CommonConversions.cs @@ -1,4 +1,5 @@ -using System.Linq.Expressions; +using System.Collections.Immutable; +using System.Linq.Expressions; using System.Runtime.CompilerServices; using ICSharpCode.CodeConverter.Util.FromRoslyn; using Microsoft.CodeAnalysis.Classification; @@ -577,7 +578,7 @@ public static CSSyntax.VariableDeclaratorSyntax CreateVariableDeclarator(string { if (operation is IPropertyReferenceOperation pro && pro.Arguments.Any() && !VisualBasicExtensions.IsDefault(pro.Property)) { - var isSetter = pro.Parent.Kind == OperationKind.SimpleAssignment && pro.Parent.Children.First() == pro; + var isSetter = pro.Parent.Kind == OperationKind.SimpleAssignment && pro.Parent.ChildOperations.First() == pro; var extraArg = isSetter ? await GetParameterizedSetterArgAsync(operation) : null; @@ -669,6 +670,7 @@ public ISymbol GetCsOriginalSymbolOrNull(ISymbol symbol) symbol = symbol.OriginalDefinition; // Construct throws an exception if ConstructedFrom differs from it, so let's use ConstructedFrom directly var symbolToFind = symbol is IMethodSymbol m ? m.ConstructedFrom : symbol; + // This no longer works for private members: https://github.com/dotnet/roslyn/issues/72369#issuecomment-1975066163 var similarSymbol = SymbolFinder.FindSimilarSymbols(symbolToFind, _csCompilation).FirstOrDefault(); return similarSymbol; } @@ -684,7 +686,7 @@ public static ExpressionSyntax ThrowawayParameters(ExpressionSyntax invocable, i public static CSSyntax.ParameterListSyntax CreateParameterList(IEnumerable ps) { - return SyntaxFactory.ParameterList(SyntaxFactory.SeparatedList(ps)); + return SyntaxFactory.ParameterList(SyntaxFactory.SeparatedList(ps.Cast())); } public static ExpressionSyntax NotNothingComparison(ExpressionSyntax otherArgument, bool isReferenceType, bool inExpressionLambda = false) @@ -747,6 +749,9 @@ public RefKind GetCsRefKind(IParameterSymbol vbParameter, Microsoft.CodeAnalysis return csParam.RefKind; } + var syntaxNodes = vbParameter?.DeclaringSyntaxReferences.Select(r => r.GetSyntax()); + optionalParameterSyntax ??= syntaxNodes?.OfType().FirstOrDefault(); + if (optionalParameterSyntax?.AttributeLists.Any(this.HasOutAttribute) == true) { return RefKind.Out; } @@ -800,4 +805,19 @@ public async Task WithRemovedRedundantConversionOrNullAsync(VB return writtenByUser ? null : this.TypeConversionAnalyzer.AddExplicitConversion(conversionArg, csharpArg, forceTargetType: forceTargetType, defaultToCast: true); } + + public SemanticModelExtensions.RefConversion GetRefConversionType(VBSyntax.ArgumentSyntax node, VBSyntax.ArgumentListSyntax argList, ImmutableArray parameters, out string argName, out RefKind refKind) + { + var parameter = node.IsNamed && node is VBSyntax.SimpleArgumentSyntax sas + ? parameters.FirstOrDefault(p => p.Name.Equals(sas.NameColonEquals.Name.Identifier.Text, StringComparison.OrdinalIgnoreCase)) + : parameters.ElementAtOrDefault(argList.Arguments.IndexOf(node)); + if (parameter != null) { + refKind = GetCsRefKind(parameter); + argName = parameter.Name; + } else { + refKind = RefKind.None; + argName = null; + } + return SemanticModel.NeedsVariableForArgument(node, refKind); + } } \ No newline at end of file diff --git a/CodeConverter/CSharp/HandledEventsAnalyzer.cs b/CodeConverter/CSharp/HandledEventsAnalyzer.cs index 6b3507c1c..f15efb17f 100644 --- a/CodeConverter/CSharp/HandledEventsAnalyzer.cs +++ b/CodeConverter/CSharp/HandledEventsAnalyzer.cs @@ -36,7 +36,9 @@ private async Task AnalyzeAsync() .ToDictionary(m => m.Key, g => g.First(), StringComparer.OrdinalIgnoreCase); // Uses the fact that GroupBy maintains addition order to get the closest declaration #pragma warning restore RS1024 // Compare symbols correctly - var writtenWithEventsProperties = await ancestorPropsMembersByName.Values.OfType().ToAsyncEnumerable().ToDictionaryAwaitAsync(async p => p.Name, async p => (p, await IsNeverWrittenOrOverriddenAsync(p)), StringComparer.OrdinalIgnoreCase); + + var writtenWithEventsProperties = await ancestorPropsMembersByName.Values.OfType().ToAsyncEnumerable() + .ToDictionaryAsync(async (p, _) => p.Name, async (p, cancellationToken) => (p, await IsNeverWrittenOrOverriddenAsync(p, cancellationToken))); var eventContainerToMethods = _type.GetMembers().OfType() .SelectMany(HandledEvents) @@ -62,10 +64,10 @@ private static int ParametersToDiscard(IEventSymbol e, IMethodSymbol handlingMet return toDiscard; } - private async Task IsNeverWrittenOrOverriddenAsync(ISymbol symbol) + private async Task IsNeverWrittenOrOverriddenAsync(ISymbol symbol, CancellationToken cancellationToken = default) { var projectSolution = _commonConversions.Document.Project.Solution; - if (!await projectSolution.IsNeverWrittenAsync(symbol, _initializeComponentLocationOrNull)) return false; + if (!await projectSolution.IsNeverWrittenAsync(symbol, _initializeComponentLocationOrNull, cancellationToken: cancellationToken)) return false; return !_typeToInheritors.Contains(symbol.ContainingType); } diff --git a/CodeConverter/CSharp/MethodBodyExecutableStatementVisitor.cs b/CodeConverter/CSharp/MethodBodyExecutableStatementVisitor.cs index cd67d4654..ee700cebb 100644 --- a/CodeConverter/CSharp/MethodBodyExecutableStatementVisitor.cs +++ b/CodeConverter/CSharp/MethodBodyExecutableStatementVisitor.cs @@ -542,7 +542,7 @@ public override async Task> VisitMultiLineIfBlock(VB elseClause = elseClause.WithVbSourceMappingFrom(node.ElseBlock); //Special case where explicit mapping is needed since block becomes clause so cannot be easily visited var elseIfBlocks = await node.ElseIfBlocks.SelectAsync(async elseIf => await ConvertElseIfAsync(elseIf)); - foreach (var elseIf in elseIfBlocks.Reverse()) { + foreach (var elseIf in Enumerable.Reverse(elseIfBlocks)) { var ifStmt = SyntaxFactory.IfStatement(elseIf.ElseIfCondition, elseIf.ElseBlock, elseClause); elseClause = SyntaxFactory.ElseClause(ifStmt); } diff --git a/CodeConverter/CSharp/NameExpressionNodeVisitor.cs b/CodeConverter/CSharp/NameExpressionNodeVisitor.cs index b32a62cc4..0deb89bfa 100644 --- a/CodeConverter/CSharp/NameExpressionNodeVisitor.cs +++ b/CodeConverter/CSharp/NameExpressionNodeVisitor.cs @@ -435,7 +435,7 @@ List GetRefParameters(VBSyntax.ArgumentListSyntax argumentList var arg = (ArgumentSyntax)CommonConversions.CsSyntaxGenerator.Argument(p.RefKind, SyntaxFactory.IdentifierName(p.Name)); arguments.Add(arg); var par = (ParameterSyntax)CommonConversions.CsSyntaxGenerator.ParameterDeclaration(p); - parameters.Add(par); + parameters.Add(par.WithDefault(null)); } return (SyntaxFactory.SeparatedList(arguments), SyntaxFactory.SeparatedList(parameters)); } @@ -452,7 +452,7 @@ private bool RequiresLocalFunction(VBSyntax.InvocationExpressionSyntax invocatio bool RequiresLocalFunction(RefConversion possibleInline, VBSyntax.InvocationExpressionSyntax invocation, IMethodSymbol invocationSymbol, VBSyntax.ArgumentSyntax a) { - var refConversion = _semanticModel.GetRefConversionType(a, invocation.ArgumentList, invocationSymbol.Parameters, out string _, out _); + var refConversion = CommonConversions.GetRefConversionType(a, invocation.ArgumentList, invocationSymbol.Parameters, out string _, out _); if (RefConversion.Inline == refConversion || possibleInline == refConversion) return false; if (!(a is VBSyntax.SimpleArgumentSyntax sas)) return false; var argExpression = sas.Expression.SkipIntoParens(); diff --git a/CodeConverter/CSharp/PerScopeState.cs b/CodeConverter/CSharp/PerScopeState.cs index 1dfb06b92..a49fff977 100644 --- a/CodeConverter/CSharp/PerScopeState.cs +++ b/CodeConverter/CSharp/PerScopeState.cs @@ -225,7 +225,7 @@ public IEnumerable ConvertContinue(VBasic.SyntaxKind vbBlockKey { var scopesToExit = _hoistedNodesPerScope.Where(x => x.ExitableKind is not VBasic.SyntaxKind.None).TakeWhile(x => x.ExitableKind != vbBlockKeywordKind && x.IsBreakableInCs).ToArray(); // Select is breakable, but not continuable, so only need to break out of it on the way to something else, not if it's last. - scopesToExit = scopesToExit.Reverse().SkipWhile(x => x.ExitableKind is VBasic.SyntaxKind.SelectKeyword).Reverse().ToArray(); + scopesToExit = Enumerable.Reverse(scopesToExit).SkipWhile(x => x.ExitableKind is VBasic.SyntaxKind.SelectKeyword).Reverse().ToArray(); var assignmentExpression = CommonConversions.Literal(true); int i = 0; foreach (var scope in scopesToExit) { @@ -253,7 +253,6 @@ private static AdditionalDeclaration HoistConditionalBreakOrContinue(ScopeState var ifTrue = new PostIfTrueBlock(scopeVar.IdentifierName, stmt); scope.HoistedNodes.Add(scopeVar); scope.HoistedNodes.Add(ifTrue); - return scopeVar; } return scopeVar; diff --git a/CodeConverter/CSharp/ProjectMergedDeclarationExtensions.cs b/CodeConverter/CSharp/ProjectMergedDeclarationExtensions.cs index cf41e9689..edd019226 100644 --- a/CodeConverter/CSharp/ProjectMergedDeclarationExtensions.cs +++ b/CodeConverter/CSharp/ProjectMergedDeclarationExtensions.cs @@ -164,7 +164,7 @@ private static async Task RenamePrefixAsync(Project project, string old for (var symbolToRename = await GetElementToRename(project); symbolToRename != null; symbolToRename = await GetElementToRename(project, toSkip)) { string newName = symbolToRename.Name.Replace(oldNamePrefix, newNamePrefix); try { - var renamedSolution = await Renamer.RenameSymbolAsync(project.Solution, symbolToRename, newName, project.Solution.Workspace.Options, cancellationToken); + var renamedSolution = await Renamer.RenameSymbolAsync(project.Solution, symbolToRename, new SymbolRenameOptions(), newName, cancellationToken); project = renamedSolution.GetProject(project.Id); } catch (Exception e) { toSkip++; diff --git a/CodeConverter/CSharp/Replacements/SimpleMethodReplacement.cs b/CodeConverter/CSharp/Replacements/SimpleMethodReplacement.cs index e4d02e392..fc27a2192 100644 --- a/CodeConverter/CSharp/Replacements/SimpleMethodReplacement.cs +++ b/CodeConverter/CSharp/Replacements/SimpleMethodReplacement.cs @@ -133,7 +133,7 @@ private static ExpressionSyntax ReplacePlaceholderArgs(ExpressionSyntax zeroOrSi private static bool QualifiedMethodNameMatches(ISymbol symbol, params string[] parts) { if (symbol == null) return false; - foreach (var part in parts.Reverse()) { + foreach (var part in Enumerable.Reverse(parts)) { if (!part.Equals(symbol.Name, StringComparison.OrdinalIgnoreCase)) return false; symbol = symbol.ContainingSymbol; } diff --git a/CodeConverter/CSharp/SemanticModelExtensions.cs b/CodeConverter/CSharp/SemanticModelExtensions.cs index b51f8e9f1..238b001bc 100644 --- a/CodeConverter/CSharp/SemanticModelExtensions.cs +++ b/CodeConverter/CSharp/SemanticModelExtensions.cs @@ -64,21 +64,6 @@ public static TSymbol GetSymbolInfoInDocument(this SemanticModel semant return semanticModel.SyntaxTree == node.SyntaxTree ? semanticModel.GetSymbolInfo(node).ExtractBestMatch() : null; } - public static RefConversion GetRefConversionType(this SemanticModel semanticModel, VBSyntax.ArgumentSyntax node, VBSyntax.ArgumentListSyntax argList, ImmutableArray parameters, out string argName, out RefKind refKind) - { - var parameter = node.IsNamed && node is VBSyntax.SimpleArgumentSyntax sas - ? parameters.FirstOrDefault(p => p.Name.Equals(sas.NameColonEquals.Name.Identifier.Text, StringComparison.OrdinalIgnoreCase)) - : parameters.ElementAtOrDefault(argList.Arguments.IndexOf(node)); - if (parameter != null) { - refKind = parameter.RefKind; - argName = parameter.Name; - } else { - refKind = RefKind.None; - argName = null; - } - return semanticModel.NeedsVariableForArgument(node, refKind); - } - public static RefConversion NeedsVariableForArgument(this SemanticModel semanticModel, VBasic.Syntax.ArgumentSyntax node, RefKind refKind) { if (refKind == RefKind.None) return RefConversion.Inline; diff --git a/CodeConverter/CSharp/TypeConversionAnalyzer.cs b/CodeConverter/CSharp/TypeConversionAnalyzer.cs index b43f7296c..d1c3d3d24 100644 --- a/CodeConverter/CSharp/TypeConversionAnalyzer.cs +++ b/CodeConverter/CSharp/TypeConversionAnalyzer.cs @@ -378,7 +378,7 @@ private static TypeConversionKind AnalyzeVbConversion(bool alwaysExplicit, IType return TypeConversionKind.EnumConversionThenCast; } if (vbConversion.IsNarrowing) { - return TypeConversionKind.DestructiveCast; + return vbConversion.IsTypeParameter ? TypeConversionKind.Conversion : TypeConversionKind.DestructiveCast; } if (alwaysExplicit) { return TypeConversionKind.NonDestructiveCast; diff --git a/CodeConverter/CSharp/UsageTypeAnalyzer.cs b/CodeConverter/CSharp/UsageTypeAnalyzer.cs index afe99a61c..342eea294 100644 --- a/CodeConverter/CSharp/UsageTypeAnalyzer.cs +++ b/CodeConverter/CSharp/UsageTypeAnalyzer.cs @@ -8,17 +8,17 @@ internal static class UsageTypeAnalyzer /// /// Only detects direct assignment, not use of ByRef, late binding, dynamic, reflection, etc. /// - public static async ValueTask IsNeverWrittenAsync(this Solution solution, ISymbol symbol, Location outsideLocation = null) + public static async ValueTask IsNeverWrittenAsync(this Solution solution, ISymbol symbol, Location outsideLocation = null, CancellationToken cancellationToken = default) { - return symbol.AllWriteUsagesKnowable() && !await ContainsWriteUsagesForAsync(solution, symbol, outsideLocation); + return symbol.AllWriteUsagesKnowable() && !await ContainsWriteUsagesForAsync(solution, symbol, outsideLocation, cancellationToken); } - public static async Task ContainsWriteUsagesForAsync(Solution solution, ISymbol symbol, Location outsideLocation = null) + public static async Task ContainsWriteUsagesForAsync(Solution solution, ISymbol symbol, Location outsideLocation = null, CancellationToken cancellationToken = default) { - var references = await GetUsagesAsync(solution, symbol, outsideLocation); + var references = await GetUsagesAsync(solution, symbol, outsideLocation, cancellationToken); var operationsReferencing = references.Select(async g => { - var semanticModel = await g.Doc.GetSemanticModelAsync(); - var syntaxRoot = await g.Doc.GetSyntaxRootAsync(); + var semanticModel = await g.Doc.GetSemanticModelAsync(cancellationToken); + var syntaxRoot = await g.Doc.GetSyntaxRootAsync(cancellationToken); return g.Usages.Select(l => syntaxRoot.FindNode(l.Location.SourceSpan)) .Select(syntaxNode => semanticModel.GetAncestorOperationOrNull(syntaxNode)); }); @@ -29,9 +29,9 @@ public static async Task ContainsWriteUsagesForAsync(Solution solution, IS return false; } - public static async Task> GetUsagesAsync(this Solution solution, ISymbol symbol, Location outsideLocation = null) + public static async Task> GetUsagesAsync(this Solution solution, ISymbol symbol, Location outsideLocation = null, CancellationToken cancellationToken = default) { - var references = await SymbolFinder.FindReferencesAsync(symbol, solution); + var references = await SymbolFinder.FindReferencesAsync(symbol, solution, cancellationToken); return references.SelectMany(r => r.Locations).GroupBy(l => (Doc: l.Document, Tree: l.Location.SourceTree)) .Select(g => (g.Key.Doc, Usages: g.Where(l => l.Location.SourceTree != outsideLocation?.SourceTree || !l.Location.SourceSpan.OverlapsWith(outsideLocation.SourceSpan)).ToArray())) .Where(g => g.Usages.Any()); diff --git a/CodeConverter/CodeConverter.csproj b/CodeConverter/CodeConverter.csproj index d90ffbd0e..a348df919 100644 --- a/CodeConverter/CodeConverter.csproj +++ b/CodeConverter/CodeConverter.csproj @@ -18,6 +18,9 @@ enable Recommended latest + + RS1039 + @@ -36,9 +39,9 @@ - - - + + + all @@ -54,8 +57,9 @@ - - + + + all diff --git a/CodeConverter/Common/DefaultReferences.cs b/CodeConverter/Common/DefaultReferences.cs index 09dd95121..54ade271e 100644 --- a/CodeConverter/Common/DefaultReferences.cs +++ b/CodeConverter/Common/DefaultReferences.cs @@ -4,6 +4,7 @@ using System.IO; using System.Linq; using System.Reflection; +using System.Threading.Tasks; using Microsoft.CodeAnalysis; namespace ICSharpCode.CodeConverter.Common; @@ -14,12 +15,14 @@ namespace ICSharpCode.CodeConverter.Common; public static class DefaultReferences { private static readonly Assembly[] DefaultAssemblies = new []{ - typeof(object), - typeof(IEnumerable), - typeof(IEnumerable<>), - typeof(ErrorEventArgs), + // ReSharper disable RedundantNameQualifier + typeof(System.Object), + typeof(System.Collections.IEnumerable), + typeof(System.Collections.Generic.IEnumerable<>), + typeof(System.IO.ErrorEventArgs), typeof(System.Text.Encoding), - typeof(Enumerable), + typeof(System.Linq.Enumerable), + typeof(System.Console), typeof(System.ComponentModel.BrowsableAttribute), typeof(System.Dynamic.DynamicObject), typeof(System.Data.DataRow), @@ -30,7 +33,9 @@ public static class DefaultReferences typeof(System.Xml.Linq.XElement), typeof(System.Linq.Expressions.Expression), typeof(Microsoft.VisualBasic.Constants), - typeof(System.Data.SqlClient.SqlCommand) + typeof(System.Data.SqlClient.SqlCommand), + typeof(System.Threading.Tasks.ParallelOptions) + // ReSharper restore RedundantNameQualifier }.Select(t => t.Assembly).Concat( new[] { Assembly.Load("System.Runtime, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a") } ).ToArray(); diff --git a/CodeConverter/Common/DocumentExtensions.cs b/CodeConverter/Common/DocumentExtensions.cs index b0e0d9de1..442513604 100644 --- a/CodeConverter/Common/DocumentExtensions.cs +++ b/CodeConverter/Common/DocumentExtensions.cs @@ -115,11 +115,11 @@ private static SyntaxNode WithWarningAnnotation(SyntaxNode node, string warningT { return node.WithAdditionalAnnotations(new SyntaxAnnotation(AnnotationConstants.ConversionErrorAnnotationKind, warningText)); } - private static OptionSet GetVBOptions(DocumentOptionSet options) + private static DocumentOptionSet GetVBOptions(DocumentOptionSet options) { return options; } - private static OptionSet GetCSOptions(DocumentOptionSet options) { + private static DocumentOptionSet GetCSOptions(DocumentOptionSet options) { return options; } } \ No newline at end of file diff --git a/CodeConverter/Common/SymbolRenamer.cs b/CodeConverter/Common/SymbolRenamer.cs index 5ee789494..11559abb6 100644 --- a/CodeConverter/Common/SymbolRenamer.cs +++ b/CodeConverter/Common/SymbolRenamer.cs @@ -31,11 +31,11 @@ public static async Task PerformRenamesAsync(Project project, IEnumerab var solution = project.Solution; foreach (var (originalSymbol, newName) in symbolsWithNewNames.OrderByDescending(s => s.Original.DeclaringSyntaxReferences.Select(x => x.Span.End).Max())) { project = solution.GetProject(project.Id); - var compilation = await project.GetCompilationAsync(); + var compilation = await project.GetCompilationAsync(cancellationToken); ISymbol currentDeclaration = SymbolFinder.FindSimilarSymbols(originalSymbol, compilation).FirstOrDefault(); if (currentDeclaration == null) continue; //Must have already renamed this symbol for a different reason - solution = await Renamer.RenameSymbolAsync(solution, currentDeclaration, newName, solution.Workspace.Options); + solution = await Renamer.RenameSymbolAsync(solution, currentDeclaration, new(), newName, cancellationToken); } return solution.GetProject(project.Id); diff --git a/CodeConverter/Common/VisualBasicCompiler.cs b/CodeConverter/Common/VisualBasicCompiler.cs index 520c1e6b1..a1d1e8fec 100644 --- a/CodeConverter/Common/VisualBasicCompiler.cs +++ b/CodeConverter/Common/VisualBasicCompiler.cs @@ -1,4 +1,5 @@ using System.Text; +using Microsoft.CodeAnalysis.Scripting; using Microsoft.CodeAnalysis.VisualBasic; namespace ICSharpCode.CodeConverter.Common; diff --git a/CommandLine/CodeConv.NetFramework/CodeConv.NetFramework.csproj b/CommandLine/CodeConv.NetFramework/CodeConv.NetFramework.csproj deleted file mode 100644 index 9a6f970b5..000000000 --- a/CommandLine/CodeConv.NetFramework/CodeConv.NetFramework.csproj +++ /dev/null @@ -1,35 +0,0 @@ - - - - Exe - net472 - ICSharpCode.CodeConverter.CodeConv.NetFramework - ICSharpCode.CodeConverter.CodeConv.NetFramework - codeconv - enable - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/CommandLine/CodeConv.NetFramework/CodeConvProgram.NetFramework.cs b/CommandLine/CodeConv.NetFramework/CodeConvProgram.NetFramework.cs deleted file mode 100644 index 299766237..000000000 --- a/CommandLine/CodeConv.NetFramework/CodeConvProgram.NetFramework.cs +++ /dev/null @@ -1,6 +0,0 @@ -namespace ICSharpCode.CodeConverter.CommandLine; - -public partial class CodeConvProgram -{ - private static readonly bool _runningInNetCore = false; -} \ No newline at end of file diff --git a/CommandLine/CodeConv.Shared/CodeConv.Shared.projitems b/CommandLine/CodeConv.Shared/CodeConv.Shared.projitems index 23003736b..1a2e17d33 100644 --- a/CommandLine/CodeConv.Shared/CodeConv.Shared.projitems +++ b/CommandLine/CodeConv.Shared/CodeConv.Shared.projitems @@ -11,7 +11,7 @@ - + diff --git a/CommandLine/CodeConv.Shared/CodeConvProgram.cs b/CommandLine/CodeConv.Shared/CodeConvProgram.cs index 60a0991d3..3f148af6d 100644 --- a/CommandLine/CodeConv.Shared/CodeConvProgram.cs +++ b/CommandLine/CodeConv.Shared/CodeConvProgram.cs @@ -150,7 +150,7 @@ private async Task ConvertAsync(IProgress progress, Cancella var properties = ParsedProperties(); var joinableTaskFactory = new JoinableTaskFactory(new JoinableTaskContext()); - var msbuildWorkspaceConverter = new MSBuildWorkspaceConverter(finalSolutionPath, CoreOnlyProjects, joinableTaskFactory, BestEffort, properties); + var msbuildWorkspaceConverter = new MsBuildWorkspaceConverter(joinableTaskFactory, finalSolutionPath, BestEffort, properties); var converterResultsEnumerable = msbuildWorkspaceConverter.ConvertProjectsWhereAsync(ShouldIncludeProject, TargetLanguage, progress, cancellationToken); await ConversionResultWriter.WriteConvertedAsync(converterResultsEnumerable, finalSolutionPath, outputDirectory, Force, true, strProgress, cancellationToken); diff --git a/CommandLine/CodeConv.Shared/MSBuildWorkspaceConverter.cs b/CommandLine/CodeConv.Shared/MSBuildWorkspaceConverter.cs index d76cab893..312f78641 100644 --- a/CommandLine/CodeConv.Shared/MSBuildWorkspaceConverter.cs +++ b/CommandLine/CodeConv.Shared/MSBuildWorkspaceConverter.cs @@ -1,64 +1,52 @@ using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; -using System.IO; +using System.Diagnostics; using System.Linq; using System.Runtime.CompilerServices; +using System.Text; using System.Threading; using System.Threading.Tasks; -using CodeConv.Shared.Util; -using ICSharpCode.CodeConverter.CommandLine.Util; -using ICSharpCode.CodeConverter.CSharp; -using ICSharpCode.CodeConverter.DotNetTool.Util; using ICSharpCode.CodeConverter.Common; +using ICSharpCode.CodeConverter.CSharp; using ICSharpCode.CodeConverter.Util; using ICSharpCode.CodeConverter.VB; -using McMaster.Extensions.CommandLineUtils; -using Microsoft.Build.Locator; using Microsoft.CodeAnalysis; -using Microsoft.CodeAnalysis.Host.Mef; using Microsoft.CodeAnalysis.MSBuild; using Microsoft.VisualStudio.Threading; namespace ICSharpCode.CodeConverter.CommandLine; -public sealed class MSBuildWorkspaceConverter : IDisposable +/// +/// Provides high-fidelity analysis of .NET solutions by mimicking the behavior of 'dotnet build'. +/// +public sealed class MsBuildWorkspaceConverter { - private readonly bool _bestEffortConversion; - private readonly string _solutionFilePath; - private readonly Dictionary _buildProps; - private readonly AsyncLazy _workspace; //Cached to avoid NullRef from OptionsService when initialized concurrently (e.g. in our tests) - private AsyncLazy? _cachedSolution; //Cached for performance of tests - private readonly bool _isNetCore; - private Version? _versionUsed; - - public MSBuildWorkspaceConverter(string solutionFilePath, bool isNetCore, JoinableTaskFactory joinableTaskFactory, bool bestEffortConversion = false, Dictionary? buildProps = null) + private readonly JoinableTaskFactory _joinableTaskFactory; + private readonly SolutionLoader _solutionLoader; + private AsyncLazy? _cachedSolution; + + // The other parameters are ignored for compatibility + public MsBuildWorkspaceConverter(JoinableTaskFactory joinableTaskFactory, string solutionFilePath, bool bestEffortConversion = false, Dictionary? buildProps = null) { - _bestEffortConversion = bestEffortConversion; - _buildProps = buildProps ?? new Dictionary(); - _buildProps.TryAdd("Configuration", "Debug"); - _buildProps.TryAdd("Platform", "AnyCPU"); - _solutionFilePath = solutionFilePath; - _isNetCore = isNetCore; - _workspace = new AsyncLazy(() => CreateWorkspaceAsync(_buildProps), joinableTaskFactory); + _joinableTaskFactory = joinableTaskFactory; + _solutionLoader = new SolutionLoader(solutionFilePath, bestEffortConversion, buildProps); } + public async IAsyncEnumerable ConvertProjectsWhereAsync(Func shouldConvertProject, Language? targetLanguage, IProgress progress, [EnumeratorCancellation] CancellationToken token) { var strProgress = new Progress(s => progress.Report(new ConversionProgress(s))); -#pragma warning disable VSTHRD012 // Provide JoinableTaskFactory where allowed - Shouldn't need main thread, and I can't access ThreadHelper without referencing VS shell. - _cachedSolution ??= new AsyncLazy(async () => await GetSolutionAsync(_solutionFilePath, strProgress)); -#pragma warning restore VSTHRD012 // Provide JoinableTaskFactory where allowed - var solution = await _cachedSolution.GetValueAsync(); + _cachedSolution ??= new AsyncLazy(async () => await _solutionLoader.AnalyzeSolutionAsync(strProgress), _joinableTaskFactory); - if (!targetLanguage.HasValue) { - targetLanguage = solution.Projects.Any(p => p.Language == LanguageNames.VisualBasic) ? Language.CS : Language.VB; - } + var solution = await _cachedSolution.GetValueAsync(token); + + targetLanguage ??= solution.Projects.Any(p => p.Language == LanguageNames.VisualBasic) ? Language.CS : Language.VB; var languageConversion = targetLanguage == Language.CS ? (ILanguageConversion)new VBToCSConversion() : new CSToVBConversion(); - languageConversion.ConversionOptions = new ConversionOptions {AbandonOptionalTasksAfter = TimeSpan.FromHours(4)}; + languageConversion.ConversionOptions = new ConversionOptions { AbandonOptionalTasksAfter = TimeSpan.FromHours(4) }; var languageNameToConvert = targetLanguage == Language.CS ? LanguageNames.VisualBasic : LanguageNames.CSharp; @@ -68,73 +56,94 @@ public async IAsyncEnumerable ConvertProjectsWhereAsync(Func

GetSolutionAsync(string projectOrSolutionFile, IProgress progress) + private class SolutionLoader { - progress.Report($"Running dotnet restore on {projectOrSolutionFile}"); - await RestorePackagesForSolutionAsync(projectOrSolutionFile); - - var workspace = await _workspace.GetValueAsync(); - var solution = string.Equals(Path.GetExtension(projectOrSolutionFile), ".sln", StringComparison.OrdinalIgnoreCase) ? await workspace.OpenSolutionAsync(projectOrSolutionFile) - : (await workspace.OpenProjectAsync(projectOrSolutionFile)).Solution; - - var errorString = await GetCompilationErrorsAsync(solution.Projects); - if (string.IsNullOrEmpty(errorString)) return solution; - errorString = " " + errorString.Replace(Environment.NewLine, Environment.NewLine + " "); - progress.Report($"Compilation errors found before conversion.:{Environment.NewLine}{errorString}"); - - bool wrongFramework = new[] { "Type 'System.Void' is not defined", "is missing from assembly" }.Any(errorString.Contains); - if (_bestEffortConversion) { - progress.Report("Attempting best effort conversion on broken input due to override"); - } else if (wrongFramework && _isNetCore) { - throw CreateException($"Compiling with dotnet core caused compilation errors, install VS2019+ or use the option `{CodeConvProgram.CoreOptionDefinition} false` to force attempted conversion with older versions (not recommended)", errorString); - } else if (wrongFramework && !_isNetCore) { - throw CreateException($"Compiling with .NET Framework MSBuild caused compilation errors, use the {CodeConvProgram.CoreOptionDefinition} true option if this is a .NET core only solution", errorString); - } else { - throw CreateException("Fix compilation errors before conversion for an accurate conversion, or as a last resort, use the best effort conversion option", errorString); + private readonly string _solutionFilePath; + private readonly bool _bestEffort; + private readonly IDictionary _buildProps; + + public SolutionLoader(string solutionFilePath, bool bestEffort, IDictionary? buildProps) + { + _solutionFilePath = solutionFilePath; + _bestEffort = bestEffort; + _buildProps = buildProps ?? new Dictionary(); } - return solution; - ValidationException CreateException(string mainMessage, string fullDetail) { - var versionUsedString = _versionUsed != null ? $"Used MSBuild {_versionUsed}.{Environment.NewLine}" : ""; - return new ValidationException($"{mainMessage}:{Environment.NewLine}{versionUsedString}{fullDetail}{Environment.NewLine}{mainMessage}"); + public async Task AnalyzeSolutionAsync(IProgress progress, string configuration = "Debug") + { + progress.Report($"Running dotnet restore on {_solutionFilePath}"); + // === PREREQUISITE: Run 'dotnet restore' === + await RunDotnetRestoreAsync(_solutionFilePath); + + // === STEP 1: Create and Configure Workspace === + var properties = new Dictionary(_buildProps) + { + { "Configuration", configuration }, + { "RunAnalyzers", "true" }, + { "RunAnalyzersDuringBuild", "true" } + }; + + using var workspace = MSBuildWorkspace.Create(properties); + + Solution solution = await workspace.OpenSolutionAsync(_solutionFilePath); + + var errorString = await GetCompilationErrorsAsync(workspace, solution.Projects); + if (string.IsNullOrEmpty(errorString)) return solution; + errorString = " " + errorString.Replace(Environment.NewLine, Environment.NewLine + " "); + progress.Report($"Compilation errors found before conversion.:{Environment.NewLine}{errorString}"); + + if (_bestEffort) { + progress.Report("Attempting best effort conversion on broken input due to override"); + } else { + throw CreateException("Fix compilation errors before conversion for an accurate conversion, or as a last resort, use the best effort conversion option", errorString); + } + + return solution; + + ValidationException CreateException(string mainMessage, string fullDetail) + { + return new ValidationException($"{mainMessage}:{Environment.NewLine}{fullDetail}{Environment.NewLine}{mainMessage}"); + } } - } - - private async Task GetCompilationErrorsAsync( - IEnumerable projectsToConvert) - { - var workspaceErrors = (await _workspace.GetValueAsync()).Diagnostics.GetErrorString(); - var errors = await projectsToConvert.ParallelSelectAwaitAsync(async x => { - var c = await x.GetCompilationAsync() ?? throw new InvalidOperationException($"Compilation could not be created for {x.Language}"); - return new[] { CompilationWarnings.WarningsForCompilation(c, c.AssemblyName) }; - }, Env.MaxDop).ToArrayAsync(); - var errorString = string.Join("\r\n", workspaceErrors.Yield().Concat(errors.SelectMany(w => w)).Where(w => w != null)); - return errorString; - } - private static async Task RestorePackagesForSolutionAsync(string solutionFile) - { - var restoreExitCode = await ProcessRunner.ConnectConsoleGetExitCodeAsync(DotNetExe.FullPathOrDefault(), "restore", solutionFile); - if (restoreExitCode != 0) throw new ValidationException("dotnet restore had a non-zero exit code."); - } - - private async Task CreateWorkspaceAsync(Dictionary buildProps) - { - if (MSBuildLocator.CanRegister) { - var instances = MSBuildLocator.QueryVisualStudioInstances().ToArray(); - var instance = instances.OrderByDescending(x => x.Version).FirstOrDefault() - ?? throw new ValidationException("No Visual Studio instance available"); - MSBuildLocator.RegisterInstance(instance); - _versionUsed = instance.Version; - AppDomain.CurrentDomain.UseVersionAgnosticAssemblyResolution(); + private async Task GetCompilationErrorsAsync(MSBuildWorkspace workspace, IEnumerable projectsToConvert) + { + var workspaceErrors = workspace.Diagnostics.GetErrorString(); + var errors = await projectsToConvert.ParallelSelectAwaitAsync(async x => { + var c = await x.GetCompilationAsync() ?? throw new InvalidOperationException($"Compilation could not be created for {x.Language}"); + return new[] { CompilationWarnings.WarningsForCompilation(c, c.AssemblyName) }; + }, Env.MaxDop).ToArrayAsync(); + var errorString = string.Join("\r\n", workspaceErrors.Yield().Concat(errors.SelectMany(w => w)).Where(w => w != null)); + return errorString; } - var hostServices = await ThreadSafeWorkspaceHelper.CreateHostServicesAsync(MSBuildMefHostServices.DefaultAssemblies); - return MSBuildWorkspace.Create(buildProps, hostServices); - } - - public void Dispose() - { - if (_workspace.IsValueCreated) _workspace.GetValueAsync().Dispose(); + private async Task RunDotnetRestoreAsync(string path) + { + var processStartInfo = new ProcessStartInfo + { + FileName = "dotnet", + Arguments = $"restore \"{path}\"", + RedirectStandardOutput = true, + RedirectStandardError = true, + UseShellExecute = false, + CreateNoWindow = true + }; + + using var process = new Process { StartInfo = processStartInfo }; + var output = new StringBuilder(); + var error = new StringBuilder(); + process.OutputDataReceived += (sender, args) => { if (args.Data != null) output.AppendLine(args.Data); }; + process.ErrorDataReceived += (sender, args) => { if (args.Data != null) error.AppendLine(args.Data); }; + process.Start(); + process.BeginOutputReadLine(); + process.BeginErrorReadLine(); + await process.WaitForExitAsync(); + if (process.ExitCode != 0) + { + throw new InvalidOperationException( + $"dotnet restore failed with exit code {process.ExitCode}.\n" + + $"Error: {error}"); + } + } } } \ No newline at end of file diff --git a/CommandLine/CodeConv/CodeConv.csproj b/CommandLine/CodeConv/CodeConv.csproj index 0aee5326b..4199df596 100644 --- a/CommandLine/CodeConv/CodeConv.csproj +++ b/CommandLine/CodeConv/CodeConv.csproj @@ -2,7 +2,7 @@ Exe - net8.0 + net10.0 true true true @@ -11,7 +11,7 @@ ICSharpCode.CodeConverter.CodeConv codeconv Bidirectional code converter for VB and C# - PackageReadme.md + PackageReadme.md https://github.com/icsharpcode/CodeConverter/ MIT CodeConvNuGetPackageIcon.png @@ -32,23 +32,13 @@ - - - - + + + all runtime; build; native; contentfiles; analyzers - - - - - - - - - diff --git a/Directory.Build.props b/Directory.Build.props index 77d093885..524ff3c27 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -4,7 +4,7 @@ true $(NoWarn);1998;NU5100 true - $(WarningsNotAsErrors);NU1605;NU1701;NU1901;NU1902;NU1903;NU1904 + $(WarningsNotAsErrors);NU1605;NU1701;NU1901;NU1902;NU1903;NU1904;NU1510;NU1903 4 true 10.0 diff --git a/DotNetBuildable.slnf b/DotNetBuildable.slnf index e7b42845c..2a8ca97b7 100644 --- a/DotNetBuildable.slnf +++ b/DotNetBuildable.slnf @@ -3,7 +3,6 @@ "path": "CodeConverter.sln", "projects": [ "CodeConverter\\CodeConverter.csproj", - "CommandLine\\CodeConv.NetFramework\\CodeConv.NetFramework.csproj", "CommandLine\\CodeConv.Shared\\CodeConv.Shared.shproj", "CommandLine\\CodeConv\\CodeConv.csproj", "Func\\Func.csproj", diff --git a/Func/Func.csproj b/Func/Func.csproj index 11d480017..f092ca925 100644 --- a/Func/Func.csproj +++ b/Func/Func.csproj @@ -7,12 +7,11 @@ disable ICSharpCode.CodeConverter.Func ICSharpCode.CodeConverter.Func - <_FunctionsSkipCleanOutput>true + <_FunctionsSkipCleanOutput>true - @@ -23,20 +22,28 @@ - + + + + + + + + + + - - - - - + + + + diff --git a/Web/WebConverter.cs b/Func/WebConverter.cs similarity index 100% rename from Web/WebConverter.cs rename to Func/WebConverter.cs diff --git a/Tests/CSharp/CaseSensitivityTests.cs b/Tests/CSharp/CaseSensitivityTests.cs index 383464187..de7502ec9 100644 --- a/Tests/CSharp/CaseSensitivityTests.cs +++ b/Tests/CSharp/CaseSensitivityTests.cs @@ -33,9 +33,9 @@ private void btnOK_Click(object sender, EventArgs e) public partial class VBIsCaseInsensitive { - private System.Web.UI.WebControls.Button _btnOk; + private Global.System.Web.UI.WebControls.Button _btnOk; - protected virtual System.Web.UI.WebControls.Button btnOk + protected virtual Global.System.Web.UI.WebControls.Button btnOk { [MethodImpl(MethodImplOptions.Synchronized)] get @@ -58,7 +58,14 @@ protected virtual System.Web.UI.WebControls.Button btnOk } } } -}"); +} +3 source compilation errors: +BC30002: Type 'System.Web.UI.Page' is not defined. +BC30002: Type 'Global.System.Web.UI.WebControls.Button' is not defined. +BC30590: Event 'Click' cannot be found. +2 target compilation errors: +CS0234: The type or namespace name 'UI' does not exist in the namespace 'System.Web' (are you missing an assembly reference?) +CS0246: The type or namespace name 'Global.System.Web.UI.WebControls.Button' could not be found (are you missing a using directive or an assembly reference?)"); } [Fact] diff --git a/Tests/CSharp/ExpressionTests/ExpressionTests.cs b/Tests/CSharp/ExpressionTests/ExpressionTests.cs index 1595a234d..ed6513a2d 100644 --- a/Tests/CSharp/ExpressionTests/ExpressionTests.cs +++ b/Tests/CSharp/ExpressionTests/ExpressionTests.cs @@ -319,7 +319,7 @@ public void Rounding() } } 1 target compilation errors: -CS1503: Argument 1: cannot convert from 'object' to 'double'"); +CS1503: Argument 1: cannot convert from 'object' to 'decimal'"); } [Fact] @@ -572,11 +572,13 @@ public partial class VisualBasicClass public VisualBasicClass() { - SomeDateDateNothing = string.IsNullOrEmpty(Conversions.ToString(SomeDate)) ? default : DateTime.Parse(Conversions.ToString(SomeDate)); + SomeDateDateNothing = string.IsNullOrEmpty(Conversions.ToString(SomeDate)) ? (object)null : DateTime.Parse(SomeDate); isNotNothing = SomeDateDateNothing is not null; isSomething = new DateTime() is var arg1 && SomeDateDateNothing.HasValue ? SomeDateDateNothing.Value == arg1 : (bool?)null; } -}"); +} +1 target compilation errors: +CS1503: Argument 1: cannot convert from 'object' to 'string'"); } [Fact] diff --git a/Tests/CSharp/ExpressionTests/LinqExpressionTests.cs b/Tests/CSharp/ExpressionTests/LinqExpressionTests.cs index 8e3153fad..d180480fe 100644 --- a/Tests/CSharp/ExpressionTests/LinqExpressionTests.cs +++ b/Tests/CSharp/ExpressionTests/LinqExpressionTests.cs @@ -388,7 +388,8 @@ Public Shared Sub X(objs As List(Of Object)) Dim MaxObj As Integer = Aggregate o In objs Into Max(o.GetHashCode()) Dim CountWhereObj As Integer = Aggregate o In objs Where o.GetHashCode() > 3 Into Count() End Sub -End Class", @"using System.Collections.Generic; +End Class", @"using System; +using System.Collections.Generic; using System.Linq; public partial class VisualBasicClass @@ -611,7 +612,8 @@ Sub Foo() Dim xs As New List(Of String) Dim y = From x In xs Group By x.Length, x.Count() Into Group End Sub -End Class", @"using System.Collections.Generic; +End Class", @"using System; +using System.Collections.Generic; using System.Linq; public partial class Class1 diff --git a/Tests/CSharp/ExpressionTests/StringExpressionTests.cs b/Tests/CSharp/ExpressionTests/StringExpressionTests.cs index 73e07b5d6..60cd54222 100644 --- a/Tests/CSharp/ExpressionTests/StringExpressionTests.cs +++ b/Tests/CSharp/ExpressionTests/StringExpressionTests.cs @@ -504,6 +504,7 @@ Public Sub TestEnumConcat() End Sub End Class", @"using System; +using System.IO; public partial class EnumTests { diff --git a/Tests/CSharp/ExpressionTests/XmlExpressionTests.cs b/Tests/CSharp/ExpressionTests/XmlExpressionTests.cs index aa064b419..d059ca7cf 100644 --- a/Tests/CSharp/ExpressionTests/XmlExpressionTests.cs +++ b/Tests/CSharp/ExpressionTests/XmlExpressionTests.cs @@ -116,22 +116,22 @@ private void TestMethod() { var catalog = new XDocument( new XElement(""Catalog"", -new XElement(""Book"", new XAttribute(""id"", ""bk101""), -new XElement(""Author"", ""Garghentini, Davide""), -new XElement(""Title"", ""XML Developer's Guide""), -new XElement(""Price"", ""44.95""), -new XElement(""Description"", @"" + new XElement(""Book"", new XAttribute(""id"", ""bk101""), + new XElement(""Author"", ""Garghentini, Davide""), + new XElement(""Title"", ""XML Developer's Guide""), + new XElement(""Price"", ""44.95""), + new XElement(""Description"", @"" An in-depth look at creating applications with "", new XElement(""technology"", ""XML""), @"". For "", new XElement(""audience"", ""beginners""), @"" or "", new XElement(""audience"", ""advanced""), @"" developers. "") -), -new XElement(""Book"", new XAttribute(""id"", ""bk331""), -new XElement(""Author"", ""Spencer, Phil""), -new XElement(""Title"", ""Developing Applications with Visual Basic .NET""), -new XElement(""Price"", ""45.95""), -new XElement(""Description"", @"" + ), + new XElement(""Book"", new XAttribute(""id"", ""bk331""), + new XElement(""Author"", ""Spencer, Phil""), + new XElement(""Title"", ""Developing Applications with Visual Basic .NET""), + new XElement(""Price"", ""45.95""), + new XElement(""Description"", @"" Get the expert insights, practical code samples, and best practices you need to advance your expertise with "", new XElement(""technology"", @""Visual @@ -140,23 +140,21 @@ and best practices you need based on professional, pragmatic guidance by today's top "", new XElement(""audience"", ""developers""), @"". "") -) + ) ) ); var htmlOutput = new XElement(""html"", - new XElement(""body"", from book in catalog.Elements(""Catalog"").Elements(""Book"") select new XElement(""div"", - new XElement(""h1"", book.Elements(""Title"").Value), - new XElement(""h3"", ""By "" + book.Elements(""Author"").Value), - new XElement(""h3"", ""Price = "" + book.Elements(""Price"").Value), - + new XElement(""h1"", book.Elements(""Title"").Value), + new XElement(""h3"", ""By "" + book.Elements(""Author"").Value), + new XElement(""h3"", ""Price = "" + book.Elements(""Price"").Value), new XElement(""h2"", ""Description""), TransformDescription((string)book.Elements(""Description"").ElementAtOrDefault(0)), new XElement(""hr"") - ) - ) - ); + ) + ) + ); } public string TransformDescription(string s) diff --git a/Tests/CSharp/MemberTests/MemberTests.cs b/Tests/CSharp/MemberTests/MemberTests.cs index c43138a57..71d5186f5 100644 --- a/Tests/CSharp/MemberTests/MemberTests.cs +++ b/Tests/CSharp/MemberTests/MemberTests.cs @@ -1154,7 +1154,7 @@ await TestConversionVisualBasicToCSharpAsync( @" Private Shared Function OpenProcess(ByVal dwDesiredAccess As AccessMask, ByVal bInheritHandle As Boolean, ByVal dwProcessId As UInteger) As IntPtr End Function", @"[DllImport(""kernel32.dll"", SetLastError = true)] -private static extern IntPtr OpenProcess(AccessMask dwDesiredAccess, bool bInheritHandle, uint dwProcessId); +private static extern nint OpenProcess(AccessMask dwDesiredAccess, bool bInheritHandle, uint dwProcessId); 1 source compilation errors: BC30002: Type 'AccessMask' is not defined. @@ -1529,7 +1529,7 @@ private void OptionalByRefWithDefault([Optional][DefaultParameterValue(""a"")] r BC30455: Argument not specified for parameter 'str2' of 'Private Sub OptionalByRefNoDefault(ByRef str2 As String)'. BC30455: Argument not specified for parameter 'str3' of 'Private Sub OptionalByRefWithDefault(ByRef str3 As String)'. 1 target compilation errors: -CS7036: There is no argument given that corresponds to the required formal parameter 'str1' of 'MissingByRefArgumentWithNoExplicitDefaultValue.ByRefNoDefault(ref string)' +CS7036: There is no argument given that corresponds to the required parameter 'str1' of 'MissingByRefArgumentWithNoExplicitDefaultValue.ByRefNoDefault(ref string)' "); } } \ No newline at end of file diff --git a/Tests/CSharp/MissingSemanticModelInfo/ExpressionTests.cs b/Tests/CSharp/MissingSemanticModelInfo/ExpressionTests.cs index 32b73591e..8c387cc85 100644 --- a/Tests/CSharp/MissingSemanticModelInfo/ExpressionTests.cs +++ b/Tests/CSharp/MissingSemanticModelInfo/ExpressionTests.cs @@ -103,7 +103,8 @@ Sub Foo() Next End Sub -End Class", @" +End Class", @"using System.Linq; + public partial class Class1 { public void Foo() diff --git a/Tests/CSharp/MultiFileSolutionAndProjectTests.cs b/Tests/CSharp/MultiFileSolutionAndProjectTests.cs index dbf97a1f6..26ba8433c 100644 --- a/Tests/CSharp/MultiFileSolutionAndProjectTests.cs +++ b/Tests/CSharp/MultiFileSolutionAndProjectTests.cs @@ -18,14 +18,14 @@ public MultiFileSolutionAndProjectTests(MultiFileTestFixture multiFileTestFixtur _multiFileTestFixture = multiFileTestFixture; } - [Fact(Skip = "CI system cannot run this at the moment due to installed SDK versions")] + [Fact()] public async Task ConvertWholeSolutionAsync() { await _multiFileTestFixture.ConvertProjectsWhereAsync(p => true, Language.CS); } - [Fact(Skip= "CI system cannot run this at the moment due to installed SDK versions")] + [Fact()] public async Task ConvertVbLibraryOnlyAsync() { await _multiFileTestFixture.ConvertProjectsWhereAsync(p => p.Name == "VbLibrary", Language.CS); diff --git a/Tests/CSharp/NamespaceLevelTests.cs b/Tests/CSharp/NamespaceLevelTests.cs index 6698bfafe..81a8c20b6 100644 --- a/Tests/CSharp/NamespaceLevelTests.cs +++ b/Tests/CSharp/NamespaceLevelTests.cs @@ -427,7 +427,7 @@ internal partial class test : IComparable 1 source compilation errors: BC30149: Class 'test' must implement 'Function CompareTo(obj As Object) As Integer' for interface 'IComparable'. 1 target compilation errors: -CS0535: 'test' does not implement interface member 'IComparable.CompareTo(object)'"); +CS0535: 'test' does not implement interface member 'IComparable.CompareTo(object?)'"); } [Fact] @@ -444,7 +444,7 @@ internal partial class ClassImplementsInterface2 : IComparable 1 source compilation errors: BC30149: Class 'ClassImplementsInterface2' must implement 'Function CompareTo(obj As Object) As Integer' for interface 'IComparable'. 1 target compilation errors: -CS0535: 'ClassImplementsInterface2' does not implement interface member 'IComparable.CompareTo(object)'"); +CS0535: 'ClassImplementsInterface2' does not implement interface member 'IComparable.CompareTo(object?)'"); } [Fact] diff --git a/Tests/CSharp/StatementTests/MethodStatementTests.cs b/Tests/CSharp/StatementTests/MethodStatementTests.cs index b2f39e433..39bfd1c73 100644 --- a/Tests/CSharp/StatementTests/MethodStatementTests.cs +++ b/Tests/CSharp/StatementTests/MethodStatementTests.cs @@ -291,7 +291,7 @@ internal partial class TestClass private void TestMethod() { string b; - b = new string(""test"".ToCharArray()); + b = new string(""test""); } }"); } @@ -325,7 +325,7 @@ internal partial class TestClass { private void TestMethod() { - string b = new string(""test"".ToCharArray()); + string b = new string(""test""); } }"); } @@ -342,7 +342,7 @@ internal partial class TestClass { private void TestMethod() { - string b = new string(""test"".ToCharArray()); + string b = new string(""test""); } }"); } @@ -608,7 +608,7 @@ public static void Main() { y._x = 1; Console.Write(y._x); - y = (TestWithForEachClass)null; + y = null; } } } diff --git a/Tests/CSharp/TypeCastTests.cs b/Tests/CSharp/TypeCastTests.cs index cace3a478..83c59f19f 100644 --- a/Tests/CSharp/TypeCastTests.cs +++ b/Tests/CSharp/TypeCastTests.cs @@ -1355,7 +1355,7 @@ internal partial class CharTestClass { private string[] QuoteSplit(string text) { - return text.Split('""'); + return text.Split(""\""""); } }"); } @@ -1553,7 +1553,7 @@ private static T GenericFunctionWithCast() } private static T GenericFunctionWithCastThatExistsInCsharp() where T : TestGenericCast { - return (T)new TestGenericCast(); + return Conversions.ToGenericParameter(new TestGenericCast()); } }"); } diff --git a/Tests/LanguageAgnostic/ParallelSelectAwaitTests.cs b/Tests/LanguageAgnostic/ParallelSelectAwaitTests.cs index 0e8223057..cee31f3a9 100644 --- a/Tests/LanguageAgnostic/ParallelSelectAwaitTests.cs +++ b/Tests/LanguageAgnostic/ParallelSelectAwaitTests.cs @@ -19,7 +19,7 @@ public async Task ExceptionDoesNotHaltPipelineAsync() return i > 3 ? i : throw new ObjectDisposedException("Original"); }, MaxDop); - Assert.Throws(() => asyncEnumerable.ToArrayAsync().GetAwaiter().GetResult()); + await Assert.ThrowsAsync(async () => await asyncEnumerable.ToArrayAsync()); } [Fact] @@ -30,7 +30,7 @@ public async Task ExceptionDoesNotHaltPipelineSyncAsync() , MaxDop ); - Assert.Throws(() => asyncEnumerable.ToArrayAsync().GetAwaiter().GetResult()); + await Assert.ThrowsAsync(async () => await asyncEnumerable.ToArrayAsync()); } [Fact] diff --git a/Tests/LanguageAgnostic/ProjectFileTextEditorTests.cs b/Tests/LanguageAgnostic/ProjectFileTextEditorTests.cs index 74d7da13b..fcd85e53e 100644 --- a/Tests/LanguageAgnostic/ProjectFileTextEditorTests.cs +++ b/Tests/LanguageAgnostic/ProjectFileTextEditorTests.cs @@ -1,5 +1,4 @@ -using System.Web.UI.WebControls; -using System.Xml.Linq; +using System.Xml.Linq; using System; using ICSharpCode.CodeConverter.Common; using Xunit; diff --git a/Tests/TestConstants.cs b/Tests/TestConstants.cs index 1c26a4128..4fa077c9c 100644 --- a/Tests/TestConstants.cs +++ b/Tests/TestConstants.cs @@ -19,8 +19,8 @@ public static class TestConstants public static string GetTestDataDirectory() { var assembly = Assembly.GetExecutingAssembly(); - var solutionDir = new FileInfo(new Uri(assembly.CodeBase).LocalPath).Directory?.Parent?.Parent ?? - throw new InvalidOperationException(assembly.CodeBase); + var solutionDir = new FileInfo(new Uri(assembly.Location).LocalPath).Directory?.Parent?.Parent ?? + throw new InvalidOperationException(assembly.Location); return Path.Combine(solutionDir.FullName, "TestData"); } } \ No newline at end of file diff --git a/Tests/TestData/MultiFileCharacterization/CSToVBResults/ConvertCSharpConsoleAppOnly/CharacterizationTestSolution.sln b/Tests/TestData/MultiFileCharacterization/CSToVBResults/ConvertCSharpConsoleAppOnly/CharacterizationTestSolution.sln index 8ea27f224..2139fcfeb 100644 --- a/Tests/TestData/MultiFileCharacterization/CSToVBResults/ConvertCSharpConsoleAppOnly/CharacterizationTestSolution.sln +++ b/Tests/TestData/MultiFileCharacterization/CSToVBResults/ConvertCSharpConsoleAppOnly/CharacterizationTestSolution.sln @@ -1,10 +1,8 @@ Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio Version 17 -VisualStudioVersion = 17.9.34321.82 +# Visual Studio Version 18 +VisualStudioVersion = 18.0.11205.157 MinimumVisualStudioVersion = 10.0.40219.1 -Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "WindowsAppVb", "WindowsAppVb\WindowsAppVb.vbproj", "{D18AB89D-1897-4779-A937-F48661E0B6B8}" -EndProject Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "CSharpConsoleApp", "ConsoleApp2\CSharpConsoleApp.vbproj", "{0544AF3F-431D-0235-0AED-2B62BEE9BFE1}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "NetCore", "NetCore\NetCore.csproj", "{73BF583C-DD55-486C-9D0F-15D3D8CC72D9}" @@ -24,7 +22,9 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CSharpNetStandardLib", "CSh EndProject Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "Prefix.VbLibrary", "Prefix.VbLibrary\Prefix.VbLibrary.vbproj", "{CFAB82CD-BA17-4F08-99E2-403FADB0C46A}" EndProject -Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "VisualBasicConsoleApp", "ConsoleApp1\VisualBasicConsoleApp.vbproj", "{C69D27C1-FF4E-43CB-BB0F-9BF811BF0F81}" +Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "WinFormsAppVb", "WinFormsAppVb\WinFormsAppVb.vbproj", "{39455F38-4197-4C3A-BB70-4E647A538BBE}" +EndProject +Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "VisualBasicConsoleApp", "VisualBasicConsoleApp\VisualBasicConsoleApp.vbproj", "{C2784C8A-2BC8-4A76-BDEC-AC59F41E1894}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -32,10 +32,6 @@ Global Release|Any CPU = Release|Any CPU EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution - {D18AB89D-1897-4779-A937-F48661E0B6B8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {D18AB89D-1897-4779-A937-F48661E0B6B8}.Debug|Any CPU.Build.0 = Debug|Any CPU - {D18AB89D-1897-4779-A937-F48661E0B6B8}.Release|Any CPU.ActiveCfg = Release|Any CPU - {D18AB89D-1897-4779-A937-F48661E0B6B8}.Release|Any CPU.Build.0 = Release|Any CPU {0544AF3F-431D-0235-0AED-2B62BEE9BFE1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {0544AF3F-431D-0235-0AED-2B62BEE9BFE1}.Debug|Any CPU.Build.0 = Debug|Any CPU {0544AF3F-431D-0235-0AED-2B62BEE9BFE1}.Release|Any CPU.ActiveCfg = Release|Any CPU @@ -64,10 +60,14 @@ Global {CFAB82CD-BA17-4F08-99E2-403FADB0C46A}.Debug|Any CPU.Build.0 = Debug|Any CPU {CFAB82CD-BA17-4F08-99E2-403FADB0C46A}.Release|Any CPU.ActiveCfg = Release|Any CPU {CFAB82CD-BA17-4F08-99E2-403FADB0C46A}.Release|Any CPU.Build.0 = Release|Any CPU - {C69D27C1-FF4E-43CB-BB0F-9BF811BF0F81}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {C69D27C1-FF4E-43CB-BB0F-9BF811BF0F81}.Debug|Any CPU.Build.0 = Debug|Any CPU - {C69D27C1-FF4E-43CB-BB0F-9BF811BF0F81}.Release|Any CPU.ActiveCfg = Release|Any CPU - {C69D27C1-FF4E-43CB-BB0F-9BF811BF0F81}.Release|Any CPU.Build.0 = Release|Any CPU + {39455F38-4197-4C3A-BB70-4E647A538BBE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {39455F38-4197-4C3A-BB70-4E647A538BBE}.Debug|Any CPU.Build.0 = Debug|Any CPU + {39455F38-4197-4C3A-BB70-4E647A538BBE}.Release|Any CPU.ActiveCfg = Release|Any CPU + {39455F38-4197-4C3A-BB70-4E647A538BBE}.Release|Any CPU.Build.0 = Release|Any CPU + {C2784C8A-2BC8-4A76-BDEC-AC59F41E1894}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {C2784C8A-2BC8-4A76-BDEC-AC59F41E1894}.Debug|Any CPU.Build.0 = Debug|Any CPU + {C2784C8A-2BC8-4A76-BDEC-AC59F41E1894}.Release|Any CPU.ActiveCfg = Release|Any CPU + {C2784C8A-2BC8-4A76-BDEC-AC59F41E1894}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/Tests/TestData/MultiFileCharacterization/CSToVBResults/ConvertCSharpConsoleAppOnly/ConsoleApp1/VisualBasicConsoleApp.vbproj b/Tests/TestData/MultiFileCharacterization/CSToVBResults/ConvertCSharpConsoleAppOnly/ConsoleApp1/VisualBasicConsoleApp.vbproj deleted file mode 100644 index 98ea9f5e0..000000000 --- a/Tests/TestData/MultiFileCharacterization/CSToVBResults/ConvertCSharpConsoleAppOnly/ConsoleApp1/VisualBasicConsoleApp.vbproj +++ /dev/null @@ -1,117 +0,0 @@ - - - - - Debug - AnyCPU - {C69D27C1-FF4E-43CB-BB0F-9BF811BF0F81} - Exe - ConsoleApp1.Module1 - ConsoleApp1 - ConsoleApp1 - 512 - Console - v4.8 - true - - - - AnyCPU - true - full - true - true - bin\Debug\ - ConsoleApp1.xml - 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022 - - - AnyCPU - pdbonly - false - true - true - bin\Release\ - ConsoleApp1.xml - 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022 - - - On - - - Binary - - - Off - - - On - - - - - - - - - - - - - - - - - - - - - - - - - - - True - Application.myapp - True - - - True - True - Resources.resx - - - True - Settings.settings - True - - - - - VbMyResourcesResXFileCodeGenerator - Resources.Designer.vb - My.Resources - Designer - - - - - MyApplicationCodeGenerator - Application.Designer.vb - - - SettingsSingleFileGenerator - My - Settings.Designer.vb - - - - - - {0544AF3F-431D-0235-0AED-2B62BEE9BFE1} - CSharpConsoleApp - - - - \ No newline at end of file diff --git a/Tests/TestData/MultiFileCharacterization/CSToVBResults/ConvertCSharpConsoleAppOnly/ConsoleApp2/CSharpConsoleApp.vbproj b/Tests/TestData/MultiFileCharacterization/CSToVBResults/ConvertCSharpConsoleAppOnly/ConsoleApp2/CSharpConsoleApp.vbproj index 243965614..aedd6664c 100644 --- a/Tests/TestData/MultiFileCharacterization/CSToVBResults/ConvertCSharpConsoleAppOnly/ConsoleApp2/CSharpConsoleApp.vbproj +++ b/Tests/TestData/MultiFileCharacterization/CSToVBResults/ConvertCSharpConsoleAppOnly/ConsoleApp2/CSharpConsoleApp.vbproj @@ -1,64 +1,20 @@ - - - + On - Debug - AnyCPU - {0544AF3F-431D-0235-0AED-2B62BEE9BFE1} + net10.0 Exe ConsoleApp2 - v4.8 - 512 - true - + false $(DefaultItemExcludes);$(ProjectDir)**\*.cs - AnyCPU - true - full - false - bin\Debug\ - DEBUG,TRACE - prompt - 4 - ConsoleApp2.xml + bin\Debug\ConsoleApp2.xml - - AnyCPU - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - - - - - - - - - - - - - - - - - - + - - {4de39d59-19c6-4e1e-910c-5ea8ba55348b} - CSharpNetStandardLib - + - \ No newline at end of file diff --git a/Tests/TestData/MultiFileCharacterization/CSToVBResults/ConvertCSharpConsoleAppOnly/ConsoleApp2/Properties/AssemblyInfo.vb b/Tests/TestData/MultiFileCharacterization/CSToVBResults/ConvertCSharpConsoleAppOnly/ConsoleApp2/Properties/AssemblyInfo.vb deleted file mode 100644 index 971b5e0bd..000000000 --- a/Tests/TestData/MultiFileCharacterization/CSToVBResults/ConvertCSharpConsoleAppOnly/ConsoleApp2/Properties/AssemblyInfo.vb +++ /dev/null @@ -1,35 +0,0 @@ -Imports System.Reflection -Imports System.Runtime.InteropServices - -' 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. - - - - - - - - - -' 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. - - -' The following GUID is for the ID of the typelib if this project is exposed to COM - - -' Version information for an assembly consists of the following four values: -' -' Major Version -' Minor Version -' Build Number -' Revision -' -' 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.*")] - - diff --git a/Tests/TestData/MultiFileCharacterization/CSToVBResults/ConvertCSharpConsoleAppOnly/VisualBasicConsoleApp/VisualBasicConsoleApp.vbproj b/Tests/TestData/MultiFileCharacterization/CSToVBResults/ConvertCSharpConsoleAppOnly/VisualBasicConsoleApp/VisualBasicConsoleApp.vbproj new file mode 100644 index 000000000..7d82f25bb --- /dev/null +++ b/Tests/TestData/MultiFileCharacterization/CSToVBResults/ConvertCSharpConsoleAppOnly/VisualBasicConsoleApp/VisualBasicConsoleApp.vbproj @@ -0,0 +1,13 @@ + + + + Exe + VisualBasicConsoleApp + net10.0 + + + + + + + diff --git a/Tests/TestData/MultiFileCharacterization/CSToVBResults/ConvertWholeSolution/CharacterizationTestSolution.sln b/Tests/TestData/MultiFileCharacterization/CSToVBResults/ConvertWholeSolution/CharacterizationTestSolution.sln index d462a1431..56531a012 100644 --- a/Tests/TestData/MultiFileCharacterization/CSToVBResults/ConvertWholeSolution/CharacterizationTestSolution.sln +++ b/Tests/TestData/MultiFileCharacterization/CSToVBResults/ConvertWholeSolution/CharacterizationTestSolution.sln @@ -1,10 +1,8 @@ Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio Version 17 -VisualStudioVersion = 17.9.34321.82 +# Visual Studio Version 18 +VisualStudioVersion = 18.0.11205.157 MinimumVisualStudioVersion = 10.0.40219.1 -Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "WindowsAppVb", "WindowsAppVb\WindowsAppVb.vbproj", "{D18AB89D-1897-4779-A937-F48661E0B6B8}" -EndProject Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "CSharpConsoleApp", "ConsoleApp2\CSharpConsoleApp.vbproj", "{0544AF3F-431D-0235-0AED-2B62BEE9BFE1}" EndProject Project("{778DAE3C-4631-46EA-AA77-85C1314464D9}") = "NetCore", "NetCore\NetCore.vbproj", "{C19BD957-110D-079D-1F57-DFADBA5B4679}" @@ -24,7 +22,9 @@ Project("{778DAE3C-4631-46EA-AA77-85C1314464D9}") = "CSharpNetStandardLib", "CSh EndProject Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "Prefix.VbLibrary", "Prefix.VbLibrary\Prefix.VbLibrary.vbproj", "{CFAB82CD-BA17-4F08-99E2-403FADB0C46A}" EndProject -Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "VisualBasicConsoleApp", "ConsoleApp1\VisualBasicConsoleApp.vbproj", "{C69D27C1-FF4E-43CB-BB0F-9BF811BF0F81}" +Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "WinFormsAppVb", "WinFormsAppVb\WinFormsAppVb.vbproj", "{39455F38-4197-4C3A-BB70-4E647A538BBE}" +EndProject +Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "VisualBasicConsoleApp", "VisualBasicConsoleApp\VisualBasicConsoleApp.vbproj", "{C2784C8A-2BC8-4A76-BDEC-AC59F41E1894}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -32,10 +32,6 @@ Global Release|Any CPU = Release|Any CPU EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution - {D18AB89D-1897-4779-A937-F48661E0B6B8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {D18AB89D-1897-4779-A937-F48661E0B6B8}.Debug|Any CPU.Build.0 = Debug|Any CPU - {D18AB89D-1897-4779-A937-F48661E0B6B8}.Release|Any CPU.ActiveCfg = Release|Any CPU - {D18AB89D-1897-4779-A937-F48661E0B6B8}.Release|Any CPU.Build.0 = Release|Any CPU {0544AF3F-431D-0235-0AED-2B62BEE9BFE1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {0544AF3F-431D-0235-0AED-2B62BEE9BFE1}.Debug|Any CPU.Build.0 = Debug|Any CPU {0544AF3F-431D-0235-0AED-2B62BEE9BFE1}.Release|Any CPU.ActiveCfg = Release|Any CPU @@ -64,10 +60,14 @@ Global {CFAB82CD-BA17-4F08-99E2-403FADB0C46A}.Debug|Any CPU.Build.0 = Debug|Any CPU {CFAB82CD-BA17-4F08-99E2-403FADB0C46A}.Release|Any CPU.ActiveCfg = Release|Any CPU {CFAB82CD-BA17-4F08-99E2-403FADB0C46A}.Release|Any CPU.Build.0 = Release|Any CPU - {C69D27C1-FF4E-43CB-BB0F-9BF811BF0F81}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {C69D27C1-FF4E-43CB-BB0F-9BF811BF0F81}.Debug|Any CPU.Build.0 = Debug|Any CPU - {C69D27C1-FF4E-43CB-BB0F-9BF811BF0F81}.Release|Any CPU.ActiveCfg = Release|Any CPU - {C69D27C1-FF4E-43CB-BB0F-9BF811BF0F81}.Release|Any CPU.Build.0 = Release|Any CPU + {39455F38-4197-4C3A-BB70-4E647A538BBE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {39455F38-4197-4C3A-BB70-4E647A538BBE}.Debug|Any CPU.Build.0 = Debug|Any CPU + {39455F38-4197-4C3A-BB70-4E647A538BBE}.Release|Any CPU.ActiveCfg = Release|Any CPU + {39455F38-4197-4C3A-BB70-4E647A538BBE}.Release|Any CPU.Build.0 = Release|Any CPU + {C2784C8A-2BC8-4A76-BDEC-AC59F41E1894}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {C2784C8A-2BC8-4A76-BDEC-AC59F41E1894}.Debug|Any CPU.Build.0 = Debug|Any CPU + {C2784C8A-2BC8-4A76-BDEC-AC59F41E1894}.Release|Any CPU.ActiveCfg = Release|Any CPU + {C2784C8A-2BC8-4A76-BDEC-AC59F41E1894}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/Tests/TestData/MultiFileCharacterization/CSToVBResults/ConvertWholeSolution/ConsoleApp1/VisualBasicConsoleApp.vbproj b/Tests/TestData/MultiFileCharacterization/CSToVBResults/ConvertWholeSolution/ConsoleApp1/VisualBasicConsoleApp.vbproj deleted file mode 100644 index 98ea9f5e0..000000000 --- a/Tests/TestData/MultiFileCharacterization/CSToVBResults/ConvertWholeSolution/ConsoleApp1/VisualBasicConsoleApp.vbproj +++ /dev/null @@ -1,117 +0,0 @@ - - - - - Debug - AnyCPU - {C69D27C1-FF4E-43CB-BB0F-9BF811BF0F81} - Exe - ConsoleApp1.Module1 - ConsoleApp1 - ConsoleApp1 - 512 - Console - v4.8 - true - - - - AnyCPU - true - full - true - true - bin\Debug\ - ConsoleApp1.xml - 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022 - - - AnyCPU - pdbonly - false - true - true - bin\Release\ - ConsoleApp1.xml - 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022 - - - On - - - Binary - - - Off - - - On - - - - - - - - - - - - - - - - - - - - - - - - - - - True - Application.myapp - True - - - True - True - Resources.resx - - - True - Settings.settings - True - - - - - VbMyResourcesResXFileCodeGenerator - Resources.Designer.vb - My.Resources - Designer - - - - - MyApplicationCodeGenerator - Application.Designer.vb - - - SettingsSingleFileGenerator - My - Settings.Designer.vb - - - - - - {0544AF3F-431D-0235-0AED-2B62BEE9BFE1} - CSharpConsoleApp - - - - \ No newline at end of file diff --git a/Tests/TestData/MultiFileCharacterization/CSToVBResults/ConvertWholeSolution/ConsoleApp2/CSharpConsoleApp.vbproj b/Tests/TestData/MultiFileCharacterization/CSToVBResults/ConvertWholeSolution/ConsoleApp2/CSharpConsoleApp.vbproj index 784de34a0..e25f79f46 100644 --- a/Tests/TestData/MultiFileCharacterization/CSToVBResults/ConvertWholeSolution/ConsoleApp2/CSharpConsoleApp.vbproj +++ b/Tests/TestData/MultiFileCharacterization/CSToVBResults/ConvertWholeSolution/ConsoleApp2/CSharpConsoleApp.vbproj @@ -1,64 +1,20 @@ - - - + On - Debug - AnyCPU - {0544AF3F-431D-0235-0AED-2B62BEE9BFE1} + net10.0 Exe ConsoleApp2 - v4.8 - 512 - true - + false $(DefaultItemExcludes);$(ProjectDir)**\*.cs - AnyCPU - true - full - false - bin\Debug\ - DEBUG,TRACE - prompt - 4 - ConsoleApp2.xml + bin\Debug\ConsoleApp2.xml - - AnyCPU - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - - - - - - - - - - - - - - - - - - + - - {FFC71C32-D59E-01EF-1354-94D6D8C2002B} - CSharpNetStandardLib - + - \ No newline at end of file diff --git a/Tests/TestData/MultiFileCharacterization/CSToVBResults/ConvertWholeSolution/ConsoleApp2/Properties/AssemblyInfo.vb b/Tests/TestData/MultiFileCharacterization/CSToVBResults/ConvertWholeSolution/ConsoleApp2/Properties/AssemblyInfo.vb deleted file mode 100644 index 971b5e0bd..000000000 --- a/Tests/TestData/MultiFileCharacterization/CSToVBResults/ConvertWholeSolution/ConsoleApp2/Properties/AssemblyInfo.vb +++ /dev/null @@ -1,35 +0,0 @@ -Imports System.Reflection -Imports System.Runtime.InteropServices - -' 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. - - - - - - - - - -' 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. - - -' The following GUID is for the ID of the typelib if this project is exposed to COM - - -' Version information for an assembly consists of the following four values: -' -' Major Version -' Minor Version -' Build Number -' Revision -' -' 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.*")] - - diff --git a/Tests/TestData/MultiFileCharacterization/CSToVBResults/ConvertWholeSolution/NetCore/NetCore.vbproj b/Tests/TestData/MultiFileCharacterization/CSToVBResults/ConvertWholeSolution/NetCore/NetCore.vbproj index 7dac1f19e..e76054599 100644 --- a/Tests/TestData/MultiFileCharacterization/CSToVBResults/ConvertWholeSolution/NetCore/NetCore.vbproj +++ b/Tests/TestData/MultiFileCharacterization/CSToVBResults/ConvertWholeSolution/NetCore/NetCore.vbproj @@ -2,7 +2,7 @@ On Exe - net472 + net10.0 $(DefaultItemExcludes);$(ProjectDir)**\*.cs \ No newline at end of file diff --git a/Tests/TestData/MultiFileCharacterization/CSToVBResults/ConvertWholeSolution/VisualBasicConsoleApp/VisualBasicConsoleApp.vbproj b/Tests/TestData/MultiFileCharacterization/CSToVBResults/ConvertWholeSolution/VisualBasicConsoleApp/VisualBasicConsoleApp.vbproj new file mode 100644 index 000000000..7d82f25bb --- /dev/null +++ b/Tests/TestData/MultiFileCharacterization/CSToVBResults/ConvertWholeSolution/VisualBasicConsoleApp/VisualBasicConsoleApp.vbproj @@ -0,0 +1,13 @@ + + + + Exe + VisualBasicConsoleApp + net10.0 + + + + + + + diff --git a/Tests/TestData/MultiFileCharacterization/SourceFiles/CharacterizationTestSolution.sln b/Tests/TestData/MultiFileCharacterization/SourceFiles/CharacterizationTestSolution.sln index 62d9b2f64..7564beaca 100644 --- a/Tests/TestData/MultiFileCharacterization/SourceFiles/CharacterizationTestSolution.sln +++ b/Tests/TestData/MultiFileCharacterization/SourceFiles/CharacterizationTestSolution.sln @@ -1,10 +1,8 @@  Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio Version 17 -VisualStudioVersion = 17.9.34321.82 +# Visual Studio Version 18 +VisualStudioVersion = 18.0.11205.157 MinimumVisualStudioVersion = 10.0.40219.1 -Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "WindowsAppVb", "WindowsAppVb\WindowsAppVb.vbproj", "{D18AB89D-1897-4779-A937-F48661E0B6B8}" -EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CSharpConsoleApp", "ConsoleApp2\CSharpConsoleApp.csproj", "{B7602E54-8F45-4DC4-88B5-E11CDC7E8B41}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "NetCore", "NetCore\NetCore.csproj", "{73BF583C-DD55-486C-9D0F-15D3D8CC72D9}" @@ -24,7 +22,9 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CSharpNetStandardLib", "CSh EndProject Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "Prefix.VbLibrary", "Prefix.VbLibrary\Prefix.VbLibrary.vbproj", "{CFAB82CD-BA17-4F08-99E2-403FADB0C46A}" EndProject -Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "VisualBasicConsoleApp", "ConsoleApp1\VisualBasicConsoleApp.vbproj", "{C69D27C1-FF4E-43CB-BB0F-9BF811BF0F81}" +Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "WinFormsAppVb", "WinFormsAppVb\WinFormsAppVb.vbproj", "{39455F38-4197-4C3A-BB70-4E647A538BBE}" +EndProject +Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "VisualBasicConsoleApp", "VisualBasicConsoleApp\VisualBasicConsoleApp.vbproj", "{C2784C8A-2BC8-4A76-BDEC-AC59F41E1894}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -32,10 +32,6 @@ Global Release|Any CPU = Release|Any CPU EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution - {D18AB89D-1897-4779-A937-F48661E0B6B8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {D18AB89D-1897-4779-A937-F48661E0B6B8}.Debug|Any CPU.Build.0 = Debug|Any CPU - {D18AB89D-1897-4779-A937-F48661E0B6B8}.Release|Any CPU.ActiveCfg = Release|Any CPU - {D18AB89D-1897-4779-A937-F48661E0B6B8}.Release|Any CPU.Build.0 = Release|Any CPU {B7602E54-8F45-4DC4-88B5-E11CDC7E8B41}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {B7602E54-8F45-4DC4-88B5-E11CDC7E8B41}.Debug|Any CPU.Build.0 = Debug|Any CPU {B7602E54-8F45-4DC4-88B5-E11CDC7E8B41}.Release|Any CPU.ActiveCfg = Release|Any CPU @@ -64,10 +60,14 @@ Global {CFAB82CD-BA17-4F08-99E2-403FADB0C46A}.Debug|Any CPU.Build.0 = Debug|Any CPU {CFAB82CD-BA17-4F08-99E2-403FADB0C46A}.Release|Any CPU.ActiveCfg = Release|Any CPU {CFAB82CD-BA17-4F08-99E2-403FADB0C46A}.Release|Any CPU.Build.0 = Release|Any CPU - {C69D27C1-FF4E-43CB-BB0F-9BF811BF0F81}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {C69D27C1-FF4E-43CB-BB0F-9BF811BF0F81}.Debug|Any CPU.Build.0 = Debug|Any CPU - {C69D27C1-FF4E-43CB-BB0F-9BF811BF0F81}.Release|Any CPU.ActiveCfg = Release|Any CPU - {C69D27C1-FF4E-43CB-BB0F-9BF811BF0F81}.Release|Any CPU.Build.0 = Release|Any CPU + {39455F38-4197-4C3A-BB70-4E647A538BBE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {39455F38-4197-4C3A-BB70-4E647A538BBE}.Debug|Any CPU.Build.0 = Debug|Any CPU + {39455F38-4197-4C3A-BB70-4E647A538BBE}.Release|Any CPU.ActiveCfg = Release|Any CPU + {39455F38-4197-4C3A-BB70-4E647A538BBE}.Release|Any CPU.Build.0 = Release|Any CPU + {C2784C8A-2BC8-4A76-BDEC-AC59F41E1894}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {C2784C8A-2BC8-4A76-BDEC-AC59F41E1894}.Debug|Any CPU.Build.0 = Debug|Any CPU + {C2784C8A-2BC8-4A76-BDEC-AC59F41E1894}.Release|Any CPU.ActiveCfg = Release|Any CPU + {C2784C8A-2BC8-4A76-BDEC-AC59F41E1894}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/Tests/TestData/MultiFileCharacterization/SourceFiles/ConsoleApp1/My Project/Application.Designer.cs b/Tests/TestData/MultiFileCharacterization/SourceFiles/ConsoleApp1/My Project/Application.Designer.cs deleted file mode 100644 index fe8d8ce90..000000000 --- a/Tests/TestData/MultiFileCharacterization/SourceFiles/ConsoleApp1/My Project/Application.Designer.cs +++ /dev/null @@ -1,21 +0,0 @@ -// ------------------------------------------------------------------------------ -// -// This code was generated by a tool. -// Runtime Version:4.0.30319.42000 -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// -// ------------------------------------------------------------------------------ - -using System.Threading.Tasks; -using System.Data; -using System.Diagnostics; -using Microsoft.VisualBasic; -using System.Linq; -using System.Collections.Generic; -using System.Collections; -using System; -using System.Xml.Linq; - - diff --git a/Tests/TestData/MultiFileCharacterization/SourceFiles/ConsoleApp1/My Project/Application.Designer.vb b/Tests/TestData/MultiFileCharacterization/SourceFiles/ConsoleApp1/My Project/Application.Designer.vb deleted file mode 100644 index 88dd01c78..000000000 --- a/Tests/TestData/MultiFileCharacterization/SourceFiles/ConsoleApp1/My Project/Application.Designer.vb +++ /dev/null @@ -1,13 +0,0 @@ -'------------------------------------------------------------------------------ -' -' This code was generated by a tool. -' Runtime Version:4.0.30319.42000 -' -' Changes to this file may cause incorrect behavior and will be lost if -' the code is regenerated. -' -'------------------------------------------------------------------------------ - -Option Strict On -Option Explicit On - diff --git a/Tests/TestData/MultiFileCharacterization/SourceFiles/ConsoleApp1/My Project/Application.myapp b/Tests/TestData/MultiFileCharacterization/SourceFiles/ConsoleApp1/My Project/Application.myapp deleted file mode 100644 index e62f1a533..000000000 --- a/Tests/TestData/MultiFileCharacterization/SourceFiles/ConsoleApp1/My Project/Application.myapp +++ /dev/null @@ -1,10 +0,0 @@ - - - false - false - 0 - true - 0 - 2 - true - diff --git a/Tests/TestData/MultiFileCharacterization/SourceFiles/ConsoleApp1/My Project/AssemblyInfo.cs b/Tests/TestData/MultiFileCharacterization/SourceFiles/ConsoleApp1/My Project/AssemblyInfo.cs deleted file mode 100644 index 5f579fc18..000000000 --- a/Tests/TestData/MultiFileCharacterization/SourceFiles/ConsoleApp1/My Project/AssemblyInfo.cs +++ /dev/null @@ -1,25 +0,0 @@ -using System.Threading.Tasks; -using System.Data; -using System.Diagnostics; -using Microsoft.VisualBasic; -using System.Linq; -using System.Collections.Generic; -using System.Collections; -using System; -using System.Xml.Linq; -using System; -using System.Reflection; -using System.Runtime.InteropServices; - -[assembly: AssemblyTitle("ConsoleApp1")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("ConsoleApp1")] -[assembly: AssemblyCopyright("Copyright © 2018")] -[assembly: AssemblyTrademark("")] -[assembly: ComVisible(false)] -[assembly: Guid("3130b95d-a38c-416f-a353-cd75539cbe19")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] - - diff --git a/Tests/TestData/MultiFileCharacterization/SourceFiles/ConsoleApp1/My Project/AssemblyInfo.vb b/Tests/TestData/MultiFileCharacterization/SourceFiles/ConsoleApp1/My Project/AssemblyInfo.vb deleted file mode 100644 index 000d88b10..000000000 --- a/Tests/TestData/MultiFileCharacterization/SourceFiles/ConsoleApp1/My Project/AssemblyInfo.vb +++ /dev/null @@ -1,35 +0,0 @@ -Imports System -Imports System.Reflection -Imports System.Runtime.InteropServices - -' 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. - -' Review the values of the assembly attributes - - - - - - - - - - -'The following GUID is for the ID of the typelib if this project is exposed to COM - - -' Version information for an assembly consists of the following four values: -' -' Major Version -' Minor Version -' Build Number -' Revision -' -' You can specify all the values or you can default the Build and Revision Numbers -' by using the '*' as shown below: -' - - - diff --git a/Tests/TestData/MultiFileCharacterization/SourceFiles/ConsoleApp1/My Project/Resources.Designer.cs b/Tests/TestData/MultiFileCharacterization/SourceFiles/ConsoleApp1/My Project/Resources.Designer.cs deleted file mode 100644 index 8a4b4bdb7..000000000 --- a/Tests/TestData/MultiFileCharacterization/SourceFiles/ConsoleApp1/My Project/Resources.Designer.cs +++ /dev/null @@ -1,74 +0,0 @@ -// ------------------------------------------------------------------------------ -// -// This code was generated by a tool. -// Runtime Version:4.0.30319.42000 -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// -// ------------------------------------------------------------------------------ - -using System.Threading.Tasks; -using System.Data; -using System.Diagnostics; -using Microsoft.VisualBasic; -using System.Linq; -using System.Collections.Generic; -using System.Collections; -using System; -using System.Xml.Linq; - - -namespace My.Resources -{ - - // This class was auto-generated by the StronglyTypedResourceBuilder - // class via a tool like ResGen or Visual Studio. - // To add or remove a member, edit your .ResX file then rerun ResGen - // with the /str option, or rebuild your VS project. - ///

- /// A strongly-typed resource class, for looking up localized strings, etc. - /// [global::System.CodeDom.Compiler.GeneratedCode("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] - [global::System.Diagnostics.DebuggerNonUserCode()] - [global::System.Runtime.CompilerServices.CompilerGenerated()] - [global::Microsoft.VisualBasic.HideModuleName()] - internal static class Resources - { - private global::System.Resources.ResourceManager resourceMan; - - private global::System.Globalization.CultureInfo resourceCulture; - - /// - /// Returns the cached ResourceManager instance used by this class. - /// [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Advanced)] - internal static global::System.Resources.ResourceManager ResourceManager - { - get - { - if (object.ReferenceEquals(resourceMan, null)) - { - global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("ConsoleApp1.Resources", typeof(Resources).Assembly); - resourceMan = temp; - } - return resourceMan; - } - } - - /// - /// Overrides the current thread's CurrentUICulture property for all - /// resource lookups using this strongly typed resource class. - /// [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Advanced)] - internal static global::System.Globalization.CultureInfo Culture - { - get - { - return resourceCulture; - } - set - { - resourceCulture = value; - } - } - } -} - diff --git a/Tests/TestData/MultiFileCharacterization/SourceFiles/ConsoleApp1/My Project/Resources.Designer.vb b/Tests/TestData/MultiFileCharacterization/SourceFiles/ConsoleApp1/My Project/Resources.Designer.vb deleted file mode 100644 index a1b900346..000000000 --- a/Tests/TestData/MultiFileCharacterization/SourceFiles/ConsoleApp1/My Project/Resources.Designer.vb +++ /dev/null @@ -1,63 +0,0 @@ -'------------------------------------------------------------------------------ -' -' This code was generated by a tool. -' Runtime Version:4.0.30319.42000 -' -' Changes to this file may cause incorrect behavior and will be lost if -' the code is regenerated. -' -'------------------------------------------------------------------------------ - -Option Strict On -Option Explicit On - -Imports System - -Namespace My.Resources - - 'This class was auto-generated by the StronglyTypedResourceBuilder - 'class via a tool like ResGen or Visual Studio. - 'To add or remove a member, edit your .ResX file then rerun ResGen - 'with the /str option, or rebuild your VS project. - ''' - ''' A strongly-typed resource class, for looking up localized strings, etc. - ''' - _ - Friend Module Resources - - Private resourceMan As Global.System.Resources.ResourceManager - - Private resourceCulture As Global.System.Globalization.CultureInfo - - ''' - ''' Returns the cached ResourceManager instance used by this class. - ''' - _ - Friend ReadOnly Property ResourceManager() As Global.System.Resources.ResourceManager - Get - If Object.ReferenceEquals(resourceMan, Nothing) Then - Dim temp As Global.System.Resources.ResourceManager = New Global.System.Resources.ResourceManager("ConsoleApp1.Resources", GetType(Resources).Assembly) - resourceMan = temp - End If - Return resourceMan - End Get - End Property - - ''' - ''' Overrides the current thread's CurrentUICulture property for all - ''' resource lookups using this strongly typed resource class. - ''' - _ - Friend Property Culture() As Global.System.Globalization.CultureInfo - Get - Return resourceCulture - End Get - Set - resourceCulture = value - End Set - End Property - End Module -End Namespace diff --git a/Tests/TestData/MultiFileCharacterization/SourceFiles/ConsoleApp1/My Project/Resources.resx b/Tests/TestData/MultiFileCharacterization/SourceFiles/ConsoleApp1/My Project/Resources.resx deleted file mode 100644 index ea9cbcdb4..000000000 --- a/Tests/TestData/MultiFileCharacterization/SourceFiles/ConsoleApp1/My Project/Resources.resx +++ /dev/null @@ -1,117 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - diff --git a/Tests/TestData/MultiFileCharacterization/SourceFiles/ConsoleApp1/My Project/Settings.Designer.cs b/Tests/TestData/MultiFileCharacterization/SourceFiles/ConsoleApp1/My Project/Settings.Designer.cs deleted file mode 100644 index e87943a68..000000000 --- a/Tests/TestData/MultiFileCharacterization/SourceFiles/ConsoleApp1/My Project/Settings.Designer.cs +++ /dev/null @@ -1,61 +0,0 @@ -// ------------------------------------------------------------------------------ -// -// This code was generated by a tool. -// Runtime Version:4.0.30319.42000 -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// -// ------------------------------------------------------------------------------ - -using System.Threading.Tasks; -using System.Data; -using System.Diagnostics; -using Microsoft.VisualBasic; -using System.Linq; -using System.Collections.Generic; -using System.Collections; -using System; -using System.Xml.Linq; - - -namespace My -{ - [global::System.Runtime.CompilerServices.CompilerGenerated()] - [global::System.CodeDom.Compiler.GeneratedCode("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Advanced)] - internal sealed partial class MySettings : global::System.Configuration.ApplicationSettingsBase - { - private static MySettings defaultInstance = (MySettings)global::System.Configuration.ApplicationSettingsBase.Synchronized(new MySettings()); - - /* TODO ERROR: Skipped IfDirectiveTrivia *//* TODO ERROR: Skipped DisabledTextTrivia *//* TODO ERROR: Skipped EndIfDirectiveTrivia */ - public static MySettings Default - { - get - { - - /* TODO ERROR: Skipped IfDirectiveTrivia *//* TODO ERROR: Skipped DisabledTextTrivia *//* TODO ERROR: Skipped EndIfDirectiveTrivia */ - return defaultInstance; - } - } - } -} - -namespace My -{ - [global::Microsoft.VisualBasic.HideModuleName()] - [global::System.Diagnostics.DebuggerNonUserCode()] - [global::System.Runtime.CompilerServices.CompilerGenerated()] - internal static class MySettingsProperty - { - [global::System.ComponentModel.Design.HelpKeyword("My.Settings")] - internal static global::ConsoleApp1.My.MySettings Settings - { - get - { - return global::ConsoleApp1.My.MySettings.Default; - } - } - } -} - diff --git a/Tests/TestData/MultiFileCharacterization/SourceFiles/ConsoleApp1/VisualBasicConsoleApp.vbproj b/Tests/TestData/MultiFileCharacterization/SourceFiles/ConsoleApp1/VisualBasicConsoleApp.vbproj deleted file mode 100644 index 67b2b1122..000000000 --- a/Tests/TestData/MultiFileCharacterization/SourceFiles/ConsoleApp1/VisualBasicConsoleApp.vbproj +++ /dev/null @@ -1,117 +0,0 @@ - - - - - Debug - AnyCPU - {C69D27C1-FF4E-43CB-BB0F-9BF811BF0F81} - Exe - ConsoleApp1.Module1 - ConsoleApp1 - ConsoleApp1 - 512 - Console - v4.8 - true - - - - AnyCPU - true - full - true - true - bin\Debug\ - ConsoleApp1.xml - 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022 - - - AnyCPU - pdbonly - false - true - true - bin\Release\ - ConsoleApp1.xml - 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022 - - - On - - - Binary - - - Off - - - On - - - - - - - - - - - - - - - - - - - - - - - - - - - True - Application.myapp - True - - - True - True - Resources.resx - - - True - Settings.settings - True - - - - - VbMyResourcesResXFileCodeGenerator - Resources.Designer.vb - My.Resources - Designer - - - - - MyApplicationCodeGenerator - Application.Designer.vb - - - SettingsSingleFileGenerator - My - Settings.Designer.vb - - - - - - {b7602e54-8f45-4dc4-88b5-e11cdc7e8b41} - CSharpConsoleApp - - - - \ No newline at end of file diff --git a/Tests/TestData/MultiFileCharacterization/SourceFiles/ConsoleApp2/CSharpConsoleApp.csproj b/Tests/TestData/MultiFileCharacterization/SourceFiles/ConsoleApp2/CSharpConsoleApp.csproj index 85b50bfa2..07c774bc4 100644 --- a/Tests/TestData/MultiFileCharacterization/SourceFiles/ConsoleApp2/CSharpConsoleApp.csproj +++ b/Tests/TestData/MultiFileCharacterization/SourceFiles/ConsoleApp2/CSharpConsoleApp.csproj @@ -1,62 +1,18 @@ - - - + - Debug - AnyCPU - {B7602E54-8F45-4DC4-88B5-E11CDC7E8B41} + net10.0 Exe ConsoleApp2 ConsoleApp2 - v4.8 - 512 - true - + false - AnyCPU - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 bin\Debug\ConsoleApp2.xml - - AnyCPU - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - - - - - - - - - - - - - - - - - - + - - {4de39d59-19c6-4e1e-910c-5ea8ba55348b} - CSharpNetStandardLib - + - \ No newline at end of file diff --git a/Tests/TestData/MultiFileCharacterization/SourceFiles/ConsoleApp2/Properties/AssemblyInfo.cs b/Tests/TestData/MultiFileCharacterization/SourceFiles/ConsoleApp2/Properties/AssemblyInfo.cs deleted file mode 100644 index 8fc583c88..000000000 --- a/Tests/TestData/MultiFileCharacterization/SourceFiles/ConsoleApp2/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,36 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -// 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("ConsoleApp2")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("ConsoleApp2")] -[assembly: AssemblyCopyright("Copyright © 2018")] -[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 -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("b7602e54-8f45-4dc4-88b5-e11cdc7e8b41")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// 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")] diff --git a/Tests/TestData/MultiFileCharacterization/SourceFiles/ConsoleApp2/Properties/AssemblyInfo.vb b/Tests/TestData/MultiFileCharacterization/SourceFiles/ConsoleApp2/Properties/AssemblyInfo.vb deleted file mode 100644 index 80799465b..000000000 --- a/Tests/TestData/MultiFileCharacterization/SourceFiles/ConsoleApp2/Properties/AssemblyInfo.vb +++ /dev/null @@ -1,16 +0,0 @@ -Imports System.Reflection -Imports System.Runtime.CompilerServices -Imports System.Runtime.InteropServices - - - - - - - - - - - - - diff --git a/Tests/TestData/MultiFileCharacterization/SourceFiles/ConsoleApp4/ConsoleApp4.vbproj b/Tests/TestData/MultiFileCharacterization/SourceFiles/ConsoleApp4/ConsoleApp4.vbproj index 59c97ca8f..ff4e8a93a 100644 --- a/Tests/TestData/MultiFileCharacterization/SourceFiles/ConsoleApp4/ConsoleApp4.vbproj +++ b/Tests/TestData/MultiFileCharacterization/SourceFiles/ConsoleApp4/ConsoleApp4.vbproj @@ -3,7 +3,7 @@ Exe ConsoleApp4 - netcoreapp3.1 + net10.0 diff --git a/Tests/TestData/MultiFileCharacterization/SourceFiles/NetCore/NetCore.csproj b/Tests/TestData/MultiFileCharacterization/SourceFiles/NetCore/NetCore.csproj index c1c1e5f3e..08ab42e4a 100644 --- a/Tests/TestData/MultiFileCharacterization/SourceFiles/NetCore/NetCore.csproj +++ b/Tests/TestData/MultiFileCharacterization/SourceFiles/NetCore/NetCore.csproj @@ -2,7 +2,7 @@ Exe - net472 + net10.0
diff --git a/Tests/TestData/MultiFileCharacterization/SourceFiles/Prefix.VbLibrary/My Project/AssemblyInfo.vb b/Tests/TestData/MultiFileCharacterization/SourceFiles/Prefix.VbLibrary/My Project/AssemblyInfo.vb deleted file mode 100644 index 20ae9495c..000000000 --- a/Tests/TestData/MultiFileCharacterization/SourceFiles/Prefix.VbLibrary/My Project/AssemblyInfo.vb +++ /dev/null @@ -1,35 +0,0 @@ -Imports System -Imports System.Reflection -Imports System.Runtime.InteropServices - -' 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. - -' Review the values of the assembly attributes - - - - - - - - - - -'The following GUID is for the ID of the typelib if this project is exposed to COM - - -' Version information for an assembly consists of the following four values: -' -' Major Version -' Minor Version -' Build Number -' Revision -' -' You can specify all the values or you can default the Build and Revision Numbers -' by using the '*' as shown below: -' - - - diff --git a/Tests/TestData/MultiFileCharacterization/SourceFiles/Prefix.VbLibrary/My Project/Settings.Designer.vb b/Tests/TestData/MultiFileCharacterization/SourceFiles/Prefix.VbLibrary/My Project/Settings.Designer.vb index 9678afcb5..316074994 100644 --- a/Tests/TestData/MultiFileCharacterization/SourceFiles/Prefix.VbLibrary/My Project/Settings.Designer.vb +++ b/Tests/TestData/MultiFileCharacterization/SourceFiles/Prefix.VbLibrary/My Project/Settings.Designer.vb @@ -18,9 +18,6 @@ Namespace My Global.System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "17.1.0.0"), _ Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _ Partial Friend NotInheritable Class MySettings - Inherits Global.System.Configuration.ApplicationSettingsBase - - Private Shared defaultInstance As MySettings = CType(Global.System.Configuration.ApplicationSettingsBase.Synchronized(New MySettings()),MySettings) #Region "My.Settings Auto-Save Functionality" #If _MyType = "WindowsForms" Then @@ -50,7 +47,7 @@ Namespace My End SyncLock End If #End If - Return defaultInstance + Return Nothing End Get End Property End Class diff --git a/Tests/TestData/MultiFileCharacterization/SourceFiles/Prefix.VbLibrary/Prefix.VbLibrary.vbproj b/Tests/TestData/MultiFileCharacterization/SourceFiles/Prefix.VbLibrary/Prefix.VbLibrary.vbproj index d44d68b87..f4f132237 100644 --- a/Tests/TestData/MultiFileCharacterization/SourceFiles/Prefix.VbLibrary/Prefix.VbLibrary.vbproj +++ b/Tests/TestData/MultiFileCharacterization/SourceFiles/Prefix.VbLibrary/Prefix.VbLibrary.vbproj @@ -1,111 +1,10 @@ - - - - - Debug - AnyCPU - {CFAB82CD-BA17-4F08-99E2-403FADB0C46A} - Library - Prefix.VbLibrary - Prefix.VbLibrary - 512 - Windows - v4.8 - true - - - - true - full - true - true - bin\Debug\ - Prefix.VbLibrary.xml - 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022 - - - pdbonly - false - true - true - bin\Release\ - Prefix.VbLibrary.xml - 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022 - - - On - - - Binary - - - Off - - - On - - - - - - - - - - - - - - - - - - - - - - - - - - - - True - Application.myapp - True - - - True - True - Resources.resx - - - True - Settings.settings - True - - - - - - - VbMyResourcesResXFileCodeGenerator - Resources.Designer.vb - My.Resources - Designer - - - - - - MyApplicationCodeGenerator - Application.Designer.vb - - - SettingsSingleFileGenerator - My - Settings.Designer.vb - - - + + + + Prefix.VbLibrary + netstandard2.1 + + + + \ No newline at end of file diff --git a/Tests/TestData/MultiFileCharacterization/SourceFiles/ConsoleApp1/AVbClass.vb b/Tests/TestData/MultiFileCharacterization/SourceFiles/VisualBasicConsoleApp/AVbClass.vb similarity index 100% rename from Tests/TestData/MultiFileCharacterization/SourceFiles/ConsoleApp1/AVbClass.vb rename to Tests/TestData/MultiFileCharacterization/SourceFiles/VisualBasicConsoleApp/AVbClass.vb diff --git a/Tests/TestData/MultiFileCharacterization/SourceFiles/VisualBasicConsoleApp/VisualBasicConsoleApp.vbproj b/Tests/TestData/MultiFileCharacterization/SourceFiles/VisualBasicConsoleApp/VisualBasicConsoleApp.vbproj new file mode 100644 index 000000000..bd110e6d7 --- /dev/null +++ b/Tests/TestData/MultiFileCharacterization/SourceFiles/VisualBasicConsoleApp/VisualBasicConsoleApp.vbproj @@ -0,0 +1,13 @@ + + + + Exe + VisualBasicConsoleApp + net10.0 + + + + + + + diff --git a/Tests/TestData/MultiFileCharacterization/SourceFiles/ConsoleApp1/App.config b/Tests/TestData/MultiFileCharacterization/SourceFiles/WinFormsAppVb/App.config similarity index 100% rename from Tests/TestData/MultiFileCharacterization/SourceFiles/ConsoleApp1/App.config rename to Tests/TestData/MultiFileCharacterization/SourceFiles/WinFormsAppVb/App.config diff --git a/Tests/TestData/MultiFileCharacterization/SourceFiles/WinFormsAppVb/ApplicationEvents.vb b/Tests/TestData/MultiFileCharacterization/SourceFiles/WinFormsAppVb/ApplicationEvents.vb new file mode 100644 index 000000000..3445e6db3 --- /dev/null +++ b/Tests/TestData/MultiFileCharacterization/SourceFiles/WinFormsAppVb/ApplicationEvents.vb @@ -0,0 +1,29 @@ +Imports Microsoft.VisualBasic.ApplicationServices + +Namespace My + ' The following events are available for MyApplication: + ' Startup: Raised when the application starts, before the startup form is created. + ' Shutdown: Raised after all application forms are closed. This event is not raised if the application terminates abnormally. + ' UnhandledException: Raised if the application encounters an unhandled exception. + ' StartupNextInstance: Raised when launching a single-instance application and the application is already active. + ' NetworkAvailabilityChanged: Raised when the network connection is connected or disconnected. + + ' **NEW** ApplyApplicationDefaults: Raised when the application queries default values to be set for the application. + + ' Example: + ' Private Sub MyApplication_ApplyApplicationDefaults(sender As Object, e As ApplyApplicationDefaultsEventArgs) Handles Me.ApplyApplicationDefaults + ' + ' ' Setting the application-wide default Font: + ' e.Font = New Font(FontFamily.GenericSansSerif, 12, FontStyle.Regular) + ' + ' ' Setting the HighDpiMode for the Application: + ' e.HighDpiMode = HighDpiMode.PerMonitorV2 + ' + ' ' If a splash dialog is used, this sets the minimum display time: + ' e.MinimumSplashScreenDisplayTime = 4000 + ' End Sub + + Partial Friend Class MyApplication + + End Class +End Namespace diff --git a/Tests/TestData/MultiFileCharacterization/SourceFiles/WindowsAppVb/Folder/FolderForm.Designer.vb b/Tests/TestData/MultiFileCharacterization/SourceFiles/WinFormsAppVb/Folder/FolderForm.Designer.vb similarity index 95% rename from Tests/TestData/MultiFileCharacterization/SourceFiles/WindowsAppVb/Folder/FolderForm.Designer.vb rename to Tests/TestData/MultiFileCharacterization/SourceFiles/WinFormsAppVb/Folder/FolderForm.Designer.vb index 8f3921d98..c562987bc 100644 --- a/Tests/TestData/MultiFileCharacterization/SourceFiles/WindowsAppVb/Folder/FolderForm.Designer.vb +++ b/Tests/TestData/MultiFileCharacterization/SourceFiles/WinFormsAppVb/Folder/FolderForm.Designer.vb @@ -54,7 +54,7 @@ Partial Class FolderForm 'ToolStripButton1 ' Me.ToolStripButton1.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image - Me.ToolStripButton1.Image = Global.WindowsAppVb.My.Resources.Resources.test + Me.ToolStripButton1.Image = Global.WinFormsAppVb.My.Resources.Resources.test Me.ToolStripButton1.ImageTransparentColor = System.Drawing.Color.Magenta Me.ToolStripButton1.Name = "ToolStripButton1" Me.ToolStripButton1.Size = New System.Drawing.Size(23, 22) @@ -63,7 +63,7 @@ Partial Class FolderForm 'ToolStripButton2 ' Me.ToolStripButton2.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image - Me.ToolStripButton2.Image = Global.WindowsAppVb.My.Resources.Resources.test2 + Me.ToolStripButton2.Image = Global.WinFormsAppVb.My.Resources.Resources.test2 Me.ToolStripButton2.ImageTransparentColor = System.Drawing.Color.Magenta Me.ToolStripButton2.Name = "ToolStripButton2" Me.ToolStripButton2.Size = New System.Drawing.Size(23, 22) @@ -72,7 +72,7 @@ Partial Class FolderForm 'ToolStripButton3 ' Me.ToolStripButton3.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image - Me.ToolStripButton3.Image = Global.WindowsAppVb.My.Resources.Resources.test3 + Me.ToolStripButton3.Image = Global.WinFormsAppVb.My.Resources.Resources.test3 Me.ToolStripButton3.ImageTransparentColor = System.Drawing.Color.Magenta Me.ToolStripButton3.Name = "ToolStripButton3" Me.ToolStripButton3.Size = New System.Drawing.Size(23, 22) @@ -81,7 +81,7 @@ Partial Class FolderForm 'ToolStripButton4 ' Me.ToolStripButton4.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image - Me.ToolStripButton4.Image = Global.WindowsAppVb.My.Resources.Resource1.test + Me.ToolStripButton4.Image = Global.WinFormsAppVb.My.Resources.Resource1.test Me.ToolStripButton4.ImageTransparentColor = System.Drawing.Color.Magenta Me.ToolStripButton4.Name = "ToolStripButton4" Me.ToolStripButton4.Size = New System.Drawing.Size(23, 22) @@ -90,7 +90,7 @@ Partial Class FolderForm 'ToolStripButton5 ' Me.ToolStripButton5.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image - Me.ToolStripButton5.Image = Global.WindowsAppVb.My.Resources.Resource1.test2 + Me.ToolStripButton5.Image = Global.WinFormsAppVb.My.Resources.Resource1.test2 Me.ToolStripButton5.ImageTransparentColor = System.Drawing.Color.Magenta Me.ToolStripButton5.Name = "ToolStripButton5" Me.ToolStripButton5.Size = New System.Drawing.Size(23, 22) @@ -99,7 +99,7 @@ Partial Class FolderForm 'ToolStripButton6 ' Me.ToolStripButton6.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image - Me.ToolStripButton6.Image = Global.WindowsAppVb.My.Resources.Resource1.test3 + Me.ToolStripButton6.Image = Global.WinFormsAppVb.My.Resources.Resource1.test3 Me.ToolStripButton6.ImageTransparentColor = System.Drawing.Color.Magenta Me.ToolStripButton6.Name = "ToolStripButton6" Me.ToolStripButton6.Size = New System.Drawing.Size(23, 22) diff --git a/Tests/TestData/MultiFileCharacterization/SourceFiles/WindowsAppVb/Folder/FolderForm.resx b/Tests/TestData/MultiFileCharacterization/SourceFiles/WinFormsAppVb/Folder/FolderForm.resx similarity index 100% rename from Tests/TestData/MultiFileCharacterization/SourceFiles/WindowsAppVb/Folder/FolderForm.resx rename to Tests/TestData/MultiFileCharacterization/SourceFiles/WinFormsAppVb/Folder/FolderForm.resx diff --git a/Tests/TestData/MultiFileCharacterization/SourceFiles/WindowsAppVb/Folder/FolderForm.vb b/Tests/TestData/MultiFileCharacterization/SourceFiles/WinFormsAppVb/Folder/FolderForm.vb similarity index 100% rename from Tests/TestData/MultiFileCharacterization/SourceFiles/WindowsAppVb/Folder/FolderForm.vb rename to Tests/TestData/MultiFileCharacterization/SourceFiles/WinFormsAppVb/Folder/FolderForm.vb diff --git a/Tests/TestData/MultiFileCharacterization/SourceFiles/WindowsAppVb/Folder/Resource2.Designer.vb b/Tests/TestData/MultiFileCharacterization/SourceFiles/WinFormsAppVb/Folder/Resource2.Designer.vb similarity index 97% rename from Tests/TestData/MultiFileCharacterization/SourceFiles/WindowsAppVb/Folder/Resource2.Designer.vb rename to Tests/TestData/MultiFileCharacterization/SourceFiles/WinFormsAppVb/Folder/Resource2.Designer.vb index b7c3af9fc..c9f17546d 100644 --- a/Tests/TestData/MultiFileCharacterization/SourceFiles/WindowsAppVb/Folder/Resource2.Designer.vb +++ b/Tests/TestData/MultiFileCharacterization/SourceFiles/WinFormsAppVb/Folder/Resource2.Designer.vb @@ -43,7 +43,7 @@ Namespace My.Resources Friend Shared ReadOnly Property ResourceManager() As Global.System.Resources.ResourceManager Get If Object.ReferenceEquals(resourceMan, Nothing) Then - Dim temp As Global.System.Resources.ResourceManager = New Global.System.Resources.ResourceManager("WindowsAppVb.Resource2", GetType(Resource2).Assembly) + Dim temp As Global.System.Resources.ResourceManager = New Global.System.Resources.ResourceManager("WinFormsAppVb.Resource2", GetType(Resource2).Assembly) resourceMan = temp End If Return resourceMan diff --git a/Tests/TestData/MultiFileCharacterization/SourceFiles/WindowsAppVb/Folder/Resource2.resx b/Tests/TestData/MultiFileCharacterization/SourceFiles/WinFormsAppVb/Folder/Resource2.resx similarity index 100% rename from Tests/TestData/MultiFileCharacterization/SourceFiles/WindowsAppVb/Folder/Resource2.resx rename to Tests/TestData/MultiFileCharacterization/SourceFiles/WinFormsAppVb/Folder/Resource2.resx diff --git a/Tests/TestData/MultiFileCharacterization/SourceFiles/WindowsAppVb/Folder/test2.png b/Tests/TestData/MultiFileCharacterization/SourceFiles/WinFormsAppVb/Folder/test2.png similarity index 100% rename from Tests/TestData/MultiFileCharacterization/SourceFiles/WindowsAppVb/Folder/test2.png rename to Tests/TestData/MultiFileCharacterization/SourceFiles/WinFormsAppVb/Folder/test2.png diff --git a/Tests/TestData/MultiFileCharacterization/SourceFiles/WindowsAppVb/Folder2/Resource3.Designer.vb b/Tests/TestData/MultiFileCharacterization/SourceFiles/WinFormsAppVb/Folder2/Resource3.Designer.vb similarity index 97% rename from Tests/TestData/MultiFileCharacterization/SourceFiles/WindowsAppVb/Folder2/Resource3.Designer.vb rename to Tests/TestData/MultiFileCharacterization/SourceFiles/WinFormsAppVb/Folder2/Resource3.Designer.vb index d20900e67..04eabcc99 100644 --- a/Tests/TestData/MultiFileCharacterization/SourceFiles/WindowsAppVb/Folder2/Resource3.Designer.vb +++ b/Tests/TestData/MultiFileCharacterization/SourceFiles/WinFormsAppVb/Folder2/Resource3.Designer.vb @@ -43,7 +43,7 @@ Namespace My.Resources Friend Shared ReadOnly Property ResourceManager() As Global.System.Resources.ResourceManager Get If Object.ReferenceEquals(resourceMan, Nothing) Then - Dim temp As Global.System.Resources.ResourceManager = New Global.System.Resources.ResourceManager("WindowsAppVb.Resource3", GetType(Resource3).Assembly) + Dim temp As Global.System.Resources.ResourceManager = New Global.System.Resources.ResourceManager("WinFormsAppVb.Resource3", GetType(Resource3).Assembly) resourceMan = temp End If Return resourceMan diff --git a/Tests/TestData/MultiFileCharacterization/SourceFiles/WindowsAppVb/Folder2/Resource3.en-US.resx b/Tests/TestData/MultiFileCharacterization/SourceFiles/WinFormsAppVb/Folder2/Resource3.en-US.resx similarity index 100% rename from Tests/TestData/MultiFileCharacterization/SourceFiles/WindowsAppVb/Folder2/Resource3.en-US.resx rename to Tests/TestData/MultiFileCharacterization/SourceFiles/WinFormsAppVb/Folder2/Resource3.en-US.resx diff --git a/Tests/TestData/MultiFileCharacterization/SourceFiles/WindowsAppVb/Folder2/Resource3.resx b/Tests/TestData/MultiFileCharacterization/SourceFiles/WinFormsAppVb/Folder2/Resource3.resx similarity index 100% rename from Tests/TestData/MultiFileCharacterization/SourceFiles/WindowsAppVb/Folder2/Resource3.resx rename to Tests/TestData/MultiFileCharacterization/SourceFiles/WinFormsAppVb/Folder2/Resource3.resx diff --git a/Tests/TestData/MultiFileCharacterization/SourceFiles/WindowsAppVb/Folder2/test3.png b/Tests/TestData/MultiFileCharacterization/SourceFiles/WinFormsAppVb/Folder2/test3.png similarity index 100% rename from Tests/TestData/MultiFileCharacterization/SourceFiles/WindowsAppVb/Folder2/test3.png rename to Tests/TestData/MultiFileCharacterization/SourceFiles/WinFormsAppVb/Folder2/test3.png diff --git a/Tests/TestData/MultiFileCharacterization/SourceFiles/WinFormsAppVb/Form1.Designer.vb b/Tests/TestData/MultiFileCharacterization/SourceFiles/WinFormsAppVb/Form1.Designer.vb new file mode 100644 index 000000000..0a21f031d --- /dev/null +++ b/Tests/TestData/MultiFileCharacterization/SourceFiles/WinFormsAppVb/Form1.Designer.vb @@ -0,0 +1,31 @@ + +Partial Class Form1 + Inherits System.Windows.Forms.Form + + 'Form overrides dispose to clean up the component list. + + Protected Overrides Sub Dispose(disposing As Boolean) + Try + If disposing AndAlso components IsNot Nothing Then + components.Dispose() + End If + Finally + MyBase.Dispose(disposing) + End Try + End Sub + + 'Required by the Windows Form Designer + Private components As System.ComponentModel.IContainer + + 'NOTE: The following procedure is required by the Windows Form Designer + 'It can be modified using the Windows Form Designer. + 'Do not modify it using the code editor. + + Private Sub InitializeComponent() + components = New System.ComponentModel.Container() + AutoScaleMode = AutoScaleMode.Font + ClientSize = New Size(800, 450) + Text = "Form1" + End Sub + +End Class diff --git a/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertVbUsingCSharpRefReturnOnly/VisualBasicUsesCSharpRefReturn/Resources.resx b/Tests/TestData/MultiFileCharacterization/SourceFiles/WinFormsAppVb/Form1.resx similarity index 90% rename from Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertVbUsingCSharpRefReturnOnly/VisualBasicUsesCSharpRefReturn/Resources.resx rename to Tests/TestData/MultiFileCharacterization/SourceFiles/WinFormsAppVb/Form1.resx index af7dbebba..1af7de150 100644 --- a/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertVbUsingCSharpRefReturnOnly/VisualBasicUsesCSharpRefReturn/Resources.resx +++ b/Tests/TestData/MultiFileCharacterization/SourceFiles/WinFormsAppVb/Form1.resx @@ -46,7 +46,7 @@ mimetype: application/x-microsoft.net.object.binary.base64 value : The object must be serialized with - : System.Serialization.Formatters.Binary.BinaryFormatter + : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter : and then encoded with base64 encoding. mimetype: application/x-microsoft.net.object.soap.base64 @@ -60,6 +60,7 @@ : and then encoded with base64 encoding. --> + @@ -68,9 +69,10 @@ - + + @@ -85,9 +87,10 @@ - + + @@ -109,9 +112,9 @@ 2.0 - System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 \ No newline at end of file diff --git a/Tests/TestData/MultiFileCharacterization/SourceFiles/WinFormsAppVb/Form1.vb b/Tests/TestData/MultiFileCharacterization/SourceFiles/WinFormsAppVb/Form1.vb new file mode 100644 index 000000000..17d659563 --- /dev/null +++ b/Tests/TestData/MultiFileCharacterization/SourceFiles/WinFormsAppVb/Form1.vb @@ -0,0 +1,3 @@ +Public Class Form1 + +End Class diff --git a/Tests/TestData/MultiFileCharacterization/SourceFiles/WindowsAppVb/My Project/Application.Designer.vb b/Tests/TestData/MultiFileCharacterization/SourceFiles/WinFormsAppVb/My Project/Application.Designer.vb similarity index 95% rename from Tests/TestData/MultiFileCharacterization/SourceFiles/WindowsAppVb/My Project/Application.Designer.vb rename to Tests/TestData/MultiFileCharacterization/SourceFiles/WinFormsAppVb/My Project/Application.Designer.vb index 874c09e97..0bdda9b6b 100644 --- a/Tests/TestData/MultiFileCharacterization/SourceFiles/WindowsAppVb/My Project/Application.Designer.vb +++ b/Tests/TestData/MultiFileCharacterization/SourceFiles/WinFormsAppVb/My Project/Application.Designer.vb @@ -32,7 +32,7 @@ Namespace My _ Protected Overrides Sub OnCreateMainForm() - Me.MainForm = Global.WindowsAppVb.WinformsDesignerTest + Me.MainForm = Global.WinFormsAppVb.WinformsDesignerTest End Sub End Class End Namespace diff --git a/Tests/TestData/MultiFileCharacterization/SourceFiles/WindowsAppVb/My Project/Application.myapp b/Tests/TestData/MultiFileCharacterization/SourceFiles/WinFormsAppVb/My Project/Application.myapp similarity index 100% rename from Tests/TestData/MultiFileCharacterization/SourceFiles/WindowsAppVb/My Project/Application.myapp rename to Tests/TestData/MultiFileCharacterization/SourceFiles/WinFormsAppVb/My Project/Application.myapp diff --git a/Tests/TestData/MultiFileCharacterization/SourceFiles/WindowsAppVb/My Project/Resources.Designer.vb b/Tests/TestData/MultiFileCharacterization/SourceFiles/WinFormsAppVb/My Project/Resources.Designer.vb similarity index 100% rename from Tests/TestData/MultiFileCharacterization/SourceFiles/WindowsAppVb/My Project/Resources.Designer.vb rename to Tests/TestData/MultiFileCharacterization/SourceFiles/WinFormsAppVb/My Project/Resources.Designer.vb diff --git a/Tests/TestData/MultiFileCharacterization/SourceFiles/WindowsAppVb/My Project/Resources.resx b/Tests/TestData/MultiFileCharacterization/SourceFiles/WinFormsAppVb/My Project/Resources.resx similarity index 100% rename from Tests/TestData/MultiFileCharacterization/SourceFiles/WindowsAppVb/My Project/Resources.resx rename to Tests/TestData/MultiFileCharacterization/SourceFiles/WinFormsAppVb/My Project/Resources.resx diff --git a/Tests/TestData/MultiFileCharacterization/SourceFiles/ConsoleApp1/My Project/Settings.Designer.vb b/Tests/TestData/MultiFileCharacterization/SourceFiles/WinFormsAppVb/My Project/Settings.Designer.vb similarity index 94% rename from Tests/TestData/MultiFileCharacterization/SourceFiles/ConsoleApp1/My Project/Settings.Designer.vb rename to Tests/TestData/MultiFileCharacterization/SourceFiles/WinFormsAppVb/My Project/Settings.Designer.vb index 62478ad1a..235377686 100644 --- a/Tests/TestData/MultiFileCharacterization/SourceFiles/ConsoleApp1/My Project/Settings.Designer.vb +++ b/Tests/TestData/MultiFileCharacterization/SourceFiles/WinFormsAppVb/My Project/Settings.Designer.vb @@ -64,9 +64,9 @@ Namespace My Friend Module MySettingsProperty _ - Friend ReadOnly Property Settings() As Global.ConsoleApp1.My.MySettings + Friend ReadOnly Property Settings() As Global.WinFormsAppVb.My.MySettings Get - Return Global.ConsoleApp1.My.MySettings.Default + Return Global.WinFormsAppVb.My.MySettings.Default End Get End Property End Module diff --git a/Tests/TestData/MultiFileCharacterization/SourceFiles/ConsoleApp1/My Project/Settings.settings b/Tests/TestData/MultiFileCharacterization/SourceFiles/WinFormsAppVb/My Project/Settings.settings similarity index 100% rename from Tests/TestData/MultiFileCharacterization/SourceFiles/ConsoleApp1/My Project/Settings.settings rename to Tests/TestData/MultiFileCharacterization/SourceFiles/WinFormsAppVb/My Project/Settings.settings diff --git a/Tests/TestData/MultiFileCharacterization/SourceFiles/WindowsAppVb/ReferencingFormThroughStatic.vb b/Tests/TestData/MultiFileCharacterization/SourceFiles/WinFormsAppVb/ReferencingFormThroughStatic.vb similarity index 100% rename from Tests/TestData/MultiFileCharacterization/SourceFiles/WindowsAppVb/ReferencingFormThroughStatic.vb rename to Tests/TestData/MultiFileCharacterization/SourceFiles/WinFormsAppVb/ReferencingFormThroughStatic.vb diff --git a/Tests/TestData/MultiFileCharacterization/SourceFiles/WindowsAppVb/Resource1.Designer.vb b/Tests/TestData/MultiFileCharacterization/SourceFiles/WinFormsAppVb/Resource1.Designer.vb similarity index 97% rename from Tests/TestData/MultiFileCharacterization/SourceFiles/WindowsAppVb/Resource1.Designer.vb rename to Tests/TestData/MultiFileCharacterization/SourceFiles/WinFormsAppVb/Resource1.Designer.vb index 2e614b97f..1a1016fe9 100644 --- a/Tests/TestData/MultiFileCharacterization/SourceFiles/WindowsAppVb/Resource1.Designer.vb +++ b/Tests/TestData/MultiFileCharacterization/SourceFiles/WinFormsAppVb/Resource1.Designer.vb @@ -43,7 +43,7 @@ Namespace My.Resources Public Shared ReadOnly Property ResourceManager() As Global.System.Resources.ResourceManager Get If Object.ReferenceEquals(resourceMan, Nothing) Then - Dim temp As Global.System.Resources.ResourceManager = New Global.System.Resources.ResourceManager("WindowsAppVb.Resource1", GetType(Resource1).Assembly) + Dim temp As Global.System.Resources.ResourceManager = New Global.System.Resources.ResourceManager("WinFormsAppVb.Resource1", GetType(Resource1).Assembly) resourceMan = temp End If Return resourceMan diff --git a/Tests/TestData/MultiFileCharacterization/SourceFiles/WindowsAppVb/Resource1.en-US.Designer.vb b/Tests/TestData/MultiFileCharacterization/SourceFiles/WinFormsAppVb/Resource1.en-US.Designer.vb similarity index 100% rename from Tests/TestData/MultiFileCharacterization/SourceFiles/WindowsAppVb/Resource1.en-US.Designer.vb rename to Tests/TestData/MultiFileCharacterization/SourceFiles/WinFormsAppVb/Resource1.en-US.Designer.vb diff --git a/Tests/TestData/MultiFileCharacterization/SourceFiles/WindowsAppVb/Resource1.en-US.resx b/Tests/TestData/MultiFileCharacterization/SourceFiles/WinFormsAppVb/Resource1.en-US.resx similarity index 100% rename from Tests/TestData/MultiFileCharacterization/SourceFiles/WindowsAppVb/Resource1.en-US.resx rename to Tests/TestData/MultiFileCharacterization/SourceFiles/WinFormsAppVb/Resource1.en-US.resx diff --git a/Tests/TestData/MultiFileCharacterization/SourceFiles/WindowsAppVb/Resource1.resx b/Tests/TestData/MultiFileCharacterization/SourceFiles/WinFormsAppVb/Resource1.resx similarity index 100% rename from Tests/TestData/MultiFileCharacterization/SourceFiles/WindowsAppVb/Resource1.resx rename to Tests/TestData/MultiFileCharacterization/SourceFiles/WinFormsAppVb/Resource1.resx diff --git a/Tests/TestData/MultiFileCharacterization/SourceFiles/WinFormsAppVb/WinFormsAppVb.vbproj b/Tests/TestData/MultiFileCharacterization/SourceFiles/WinFormsAppVb/WinFormsAppVb.vbproj new file mode 100644 index 000000000..5f48b39fb --- /dev/null +++ b/Tests/TestData/MultiFileCharacterization/SourceFiles/WinFormsAppVb/WinFormsAppVb.vbproj @@ -0,0 +1,36 @@ + + + + WinExe + net10.0-windows + Sub Main + true + WindowsForms + + + + + + + + + + + + + + + True + True + Application.myapp + + + + + + MyApplicationCodeGenerator + Application.Designer.vb + + + + \ No newline at end of file diff --git a/Tests/TestData/MultiFileCharacterization/SourceFiles/WindowsAppVb/WindowsAppVb.vbproj b/Tests/TestData/MultiFileCharacterization/SourceFiles/WinFormsAppVb/WindowsAppVb.vbproj similarity index 96% rename from Tests/TestData/MultiFileCharacterization/SourceFiles/WindowsAppVb/WindowsAppVb.vbproj rename to Tests/TestData/MultiFileCharacterization/SourceFiles/WinFormsAppVb/WindowsAppVb.vbproj index e18703af8..fcca337ba 100644 --- a/Tests/TestData/MultiFileCharacterization/SourceFiles/WindowsAppVb/WindowsAppVb.vbproj +++ b/Tests/TestData/MultiFileCharacterization/SourceFiles/WinFormsAppVb/WindowsAppVb.vbproj @@ -14,6 +14,7 @@ v4.8 true + true
AnyCPU @@ -186,5 +187,11 @@ VbNetStandardLib + + + 4.6.1 + + +
\ No newline at end of file diff --git a/Tests/TestData/MultiFileCharacterization/SourceFiles/WindowsAppVb/WinformsDesignerTest.Designer.vb b/Tests/TestData/MultiFileCharacterization/SourceFiles/WinFormsAppVb/WinformsDesignerTest.Designer.vb similarity index 100% rename from Tests/TestData/MultiFileCharacterization/SourceFiles/WindowsAppVb/WinformsDesignerTest.Designer.vb rename to Tests/TestData/MultiFileCharacterization/SourceFiles/WinFormsAppVb/WinformsDesignerTest.Designer.vb diff --git a/Tests/TestData/MultiFileCharacterization/SourceFiles/WindowsAppVb/WinformsDesignerTest.resx b/Tests/TestData/MultiFileCharacterization/SourceFiles/WinFormsAppVb/WinformsDesignerTest.resx similarity index 100% rename from Tests/TestData/MultiFileCharacterization/SourceFiles/WindowsAppVb/WinformsDesignerTest.resx rename to Tests/TestData/MultiFileCharacterization/SourceFiles/WinFormsAppVb/WinformsDesignerTest.resx diff --git a/Tests/TestData/MultiFileCharacterization/SourceFiles/WindowsAppVb/WinformsDesignerTest.vb b/Tests/TestData/MultiFileCharacterization/SourceFiles/WinFormsAppVb/WinformsDesignerTest.vb similarity index 100% rename from Tests/TestData/MultiFileCharacterization/SourceFiles/WindowsAppVb/WinformsDesignerTest.vb rename to Tests/TestData/MultiFileCharacterization/SourceFiles/WinFormsAppVb/WinformsDesignerTest.vb diff --git a/Tests/TestData/MultiFileCharacterization/SourceFiles/WindowsAppVb/test.png b/Tests/TestData/MultiFileCharacterization/SourceFiles/WinFormsAppVb/test.png similarity index 100% rename from Tests/TestData/MultiFileCharacterization/SourceFiles/WindowsAppVb/test.png rename to Tests/TestData/MultiFileCharacterization/SourceFiles/WinFormsAppVb/test.png diff --git a/Tests/TestData/MultiFileCharacterization/SourceFiles/WindowsAppVb/App.config b/Tests/TestData/MultiFileCharacterization/SourceFiles/WindowsAppVb/App.config deleted file mode 100644 index a86c64659..000000000 --- a/Tests/TestData/MultiFileCharacterization/SourceFiles/WindowsAppVb/App.config +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/Tests/TestData/MultiFileCharacterization/SourceFiles/WindowsAppVb/My Project/AssemblyInfo.vb b/Tests/TestData/MultiFileCharacterization/SourceFiles/WindowsAppVb/My Project/AssemblyInfo.vb deleted file mode 100644 index ae9fa2302..000000000 --- a/Tests/TestData/MultiFileCharacterization/SourceFiles/WindowsAppVb/My Project/AssemblyInfo.vb +++ /dev/null @@ -1,35 +0,0 @@ -Imports System -Imports System.Reflection -Imports System.Runtime.InteropServices - -' 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. - -' Review the values of the assembly attributes - - - - - - - - - - -'The following GUID is for the ID of the typelib if this project is exposed to COM - - -' Version information for an assembly consists of the following four values: -' -' Major Version -' Minor Version -' Build Number -' Revision -' -' You can specify all the values or you can default the Build and Revision Numbers -' by using the '*' as shown below: -' - - - diff --git a/Tests/TestData/MultiFileCharacterization/SourceFiles/WindowsAppVb/My Project/Settings.Designer.vb b/Tests/TestData/MultiFileCharacterization/SourceFiles/WindowsAppVb/My Project/Settings.Designer.vb deleted file mode 100644 index e993f30bd..000000000 --- a/Tests/TestData/MultiFileCharacterization/SourceFiles/WindowsAppVb/My Project/Settings.Designer.vb +++ /dev/null @@ -1,73 +0,0 @@ -'------------------------------------------------------------------------------ -' -' This code was generated by a tool. -' Runtime Version:4.0.30319.42000 -' -' Changes to this file may cause incorrect behavior and will be lost if -' the code is regenerated. -' -'------------------------------------------------------------------------------ - -Option Strict On -Option Explicit On - - -Namespace My - - _ - Partial Friend NotInheritable Class MySettings - Inherits Global.System.Configuration.ApplicationSettingsBase - - Private Shared defaultInstance As MySettings = CType(Global.System.Configuration.ApplicationSettingsBase.Synchronized(New MySettings()),MySettings) - -#Region "My.Settings Auto-Save Functionality" -#If _MyType = "WindowsForms" Then - Private Shared addedHandler As Boolean - - Private Shared addedHandlerLockObject As New Object - - _ - Private Shared Sub AutoSaveSettings(sender As Global.System.Object, e As Global.System.EventArgs) - If My.Application.SaveMySettingsOnExit Then - My.Settings.Save() - End If - End Sub -#End If -#End Region - - Public Shared ReadOnly Property [Default]() As MySettings - Get - -#If _MyType = "WindowsForms" Then - If Not addedHandler Then - SyncLock addedHandlerLockObject - If Not addedHandler Then - AddHandler My.Application.Shutdown, AddressOf AutoSaveSettings - addedHandler = True - End If - End SyncLock - End If -#End If - Return defaultInstance - End Get - End Property - End Class -End Namespace - -Namespace My - - _ - Friend Module MySettingsProperty - - _ - Friend ReadOnly Property Settings() As Global.WindowsAppVb.My.MySettings - Get - Return Global.WindowsAppVb.My.MySettings.Default - End Get - End Property - End Module -End Namespace diff --git a/Tests/TestData/MultiFileCharacterization/SourceFiles/WindowsAppVb/My Project/Settings.settings b/Tests/TestData/MultiFileCharacterization/SourceFiles/WindowsAppVb/My Project/Settings.settings deleted file mode 100644 index 85b890b3c..000000000 --- a/Tests/TestData/MultiFileCharacterization/SourceFiles/WindowsAppVb/My Project/Settings.settings +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertVbLibraryOnly/CharacterizationTestSolution.sln b/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertVbLibraryOnly/CharacterizationTestSolution.sln index bb2bf81ad..815d2303a 100644 --- a/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertVbLibraryOnly/CharacterizationTestSolution.sln +++ b/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertVbLibraryOnly/CharacterizationTestSolution.sln @@ -1,10 +1,8 @@ Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio Version 17 -VisualStudioVersion = 17.9.34321.82 +# Visual Studio Version 18 +VisualStudioVersion = 18.0.11205.157 MinimumVisualStudioVersion = 10.0.40219.1 -Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "WindowsAppVb", "WindowsAppVb\WindowsAppVb.vbproj", "{D18AB89D-1897-4779-A937-F48661E0B6B8}" -EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CSharpConsoleApp", "ConsoleApp2\CSharpConsoleApp.csproj", "{B7602E54-8F45-4DC4-88B5-E11CDC7E8B41}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "NetCore", "NetCore\NetCore.csproj", "{73BF583C-DD55-486C-9D0F-15D3D8CC72D9}" @@ -24,7 +22,9 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CSharpNetStandardLib", "CSh EndProject Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "Prefix.VbLibrary", "Prefix.VbLibrary\Prefix.VbLibrary.vbproj", "{CFAB82CD-BA17-4F08-99E2-403FADB0C46A}" EndProject -Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "VisualBasicConsoleApp", "ConsoleApp1\VisualBasicConsoleApp.vbproj", "{C69D27C1-FF4E-43CB-BB0F-9BF811BF0F81}" +Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "WinFormsAppVb", "WinFormsAppVb\WinFormsAppVb.vbproj", "{39455F38-4197-4C3A-BB70-4E647A538BBE}" +EndProject +Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "VisualBasicConsoleApp", "VisualBasicConsoleApp\VisualBasicConsoleApp.vbproj", "{C2784C8A-2BC8-4A76-BDEC-AC59F41E1894}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -32,10 +32,6 @@ Global Release|Any CPU = Release|Any CPU EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution - {D18AB89D-1897-4779-A937-F48661E0B6B8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {D18AB89D-1897-4779-A937-F48661E0B6B8}.Debug|Any CPU.Build.0 = Debug|Any CPU - {D18AB89D-1897-4779-A937-F48661E0B6B8}.Release|Any CPU.ActiveCfg = Release|Any CPU - {D18AB89D-1897-4779-A937-F48661E0B6B8}.Release|Any CPU.Build.0 = Release|Any CPU {B7602E54-8F45-4DC4-88B5-E11CDC7E8B41}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {B7602E54-8F45-4DC4-88B5-E11CDC7E8B41}.Debug|Any CPU.Build.0 = Debug|Any CPU {B7602E54-8F45-4DC4-88B5-E11CDC7E8B41}.Release|Any CPU.ActiveCfg = Release|Any CPU @@ -64,10 +60,14 @@ Global {CFAB82CD-BA17-4F08-99E2-403FADB0C46A}.Debug|Any CPU.Build.0 = Debug|Any CPU {CFAB82CD-BA17-4F08-99E2-403FADB0C46A}.Release|Any CPU.ActiveCfg = Release|Any CPU {CFAB82CD-BA17-4F08-99E2-403FADB0C46A}.Release|Any CPU.Build.0 = Release|Any CPU - {C69D27C1-FF4E-43CB-BB0F-9BF811BF0F81}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {C69D27C1-FF4E-43CB-BB0F-9BF811BF0F81}.Debug|Any CPU.Build.0 = Debug|Any CPU - {C69D27C1-FF4E-43CB-BB0F-9BF811BF0F81}.Release|Any CPU.ActiveCfg = Release|Any CPU - {C69D27C1-FF4E-43CB-BB0F-9BF811BF0F81}.Release|Any CPU.Build.0 = Release|Any CPU + {39455F38-4197-4C3A-BB70-4E647A538BBE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {39455F38-4197-4C3A-BB70-4E647A538BBE}.Debug|Any CPU.Build.0 = Debug|Any CPU + {39455F38-4197-4C3A-BB70-4E647A538BBE}.Release|Any CPU.ActiveCfg = Release|Any CPU + {39455F38-4197-4C3A-BB70-4E647A538BBE}.Release|Any CPU.Build.0 = Release|Any CPU + {C2784C8A-2BC8-4A76-BDEC-AC59F41E1894}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {C2784C8A-2BC8-4A76-BDEC-AC59F41E1894}.Debug|Any CPU.Build.0 = Debug|Any CPU + {C2784C8A-2BC8-4A76-BDEC-AC59F41E1894}.Release|Any CPU.ActiveCfg = Release|Any CPU + {C2784C8A-2BC8-4A76-BDEC-AC59F41E1894}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertVbUsingCSharpRefReturnOnly/CharacterizationTestSolution.sln b/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertVbUsingCSharpRefReturnOnly/CharacterizationTestSolution.sln deleted file mode 100644 index acd902558..000000000 --- a/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertVbUsingCSharpRefReturnOnly/CharacterizationTestSolution.sln +++ /dev/null @@ -1,90 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio Version 17 -VisualStudioVersion = 17.9.34321.82 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "WindowsAppVb", "WindowsAppVb\WindowsAppVb.vbproj", "{D18AB89D-1897-4779-A937-F48661E0B6B8}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CSharpConsoleApp", "ConsoleApp2\CSharpConsoleApp.csproj", "{B7602E54-8F45-4DC4-88B5-E11CDC7E8B41}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "NetCore", "NetCore\NetCore.csproj", "{73BF583C-DD55-486C-9D0F-15D3D8CC72D9}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{5E8B06A8-42BC-4D2A-A769-66A2352F215E}" - ProjectSection(SolutionItems) = preProject - ユニコード.txt = ユニコード.txt - EndProjectSection -EndProject -Project("{778DAE3C-4631-46EA-AA77-85C1314464D9}") = "VbLibrary", "VbLibrary\VbLibrary.vbproj", "{23195658-FBE7-4A3E-B79D-91AAC2D428E7}" -EndProject -Project("{778DAE3C-4631-46EA-AA77-85C1314464D9}") = "VbNetStandardLib", "VbNetStandardLib\VbNetStandardLib.vbproj", "{FBFBE639-A532-408A-960D-288E05FEEB0E}" -EndProject -Project("{778DAE3C-4631-46EA-AA77-85C1314464D9}") = "ConsoleApp4", "ConsoleApp4\ConsoleApp4.vbproj", "{68361F37-56E9-4B49-AFF3-F1AF9938A97F}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CSharpNetStandardLib", "CSharpNetStandardLib\CSharpNetStandardLib.csproj", "{4DE39D59-19C6-4E1E-910C-5EA8BA55348B}" -EndProject -Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "Prefix.VbLibrary", "Prefix.VbLibrary\Prefix.VbLibrary.vbproj", "{CFAB82CD-BA17-4F08-99E2-403FADB0C46A}" -EndProject -Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "VisualBasicConsoleApp", "ConsoleApp1\VisualBasicConsoleApp.vbproj", "{C69D27C1-FF4E-43CB-BB0F-9BF811BF0F81}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CSharpRefReturn", "CSharpRefReturn\CSharpRefReturn.csproj", "{8B843547-F49D-40A2-8C4E-1B81D8C5D589}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "VisualBasicUsingCSharpRefReturn", "VisualBasicUsesCSharpRefReturn\VisualBasicUsingCSharpRefReturn.csproj", "{D0421946-845F-09E8-2545-DE3EB2218254}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {D18AB89D-1897-4779-A937-F48661E0B6B8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {D18AB89D-1897-4779-A937-F48661E0B6B8}.Debug|Any CPU.Build.0 = Debug|Any CPU - {D18AB89D-1897-4779-A937-F48661E0B6B8}.Release|Any CPU.ActiveCfg = Release|Any CPU - {D18AB89D-1897-4779-A937-F48661E0B6B8}.Release|Any CPU.Build.0 = Release|Any CPU - {B7602E54-8F45-4DC4-88B5-E11CDC7E8B41}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {B7602E54-8F45-4DC4-88B5-E11CDC7E8B41}.Debug|Any CPU.Build.0 = Debug|Any CPU - {B7602E54-8F45-4DC4-88B5-E11CDC7E8B41}.Release|Any CPU.ActiveCfg = Release|Any CPU - {B7602E54-8F45-4DC4-88B5-E11CDC7E8B41}.Release|Any CPU.Build.0 = Release|Any CPU - {73BF583C-DD55-486C-9D0F-15D3D8CC72D9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {73BF583C-DD55-486C-9D0F-15D3D8CC72D9}.Debug|Any CPU.Build.0 = Debug|Any CPU - {73BF583C-DD55-486C-9D0F-15D3D8CC72D9}.Release|Any CPU.ActiveCfg = Release|Any CPU - {73BF583C-DD55-486C-9D0F-15D3D8CC72D9}.Release|Any CPU.Build.0 = Release|Any CPU - {23195658-FBE7-4A3E-B79D-91AAC2D428E7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {23195658-FBE7-4A3E-B79D-91AAC2D428E7}.Debug|Any CPU.Build.0 = Debug|Any CPU - {23195658-FBE7-4A3E-B79D-91AAC2D428E7}.Release|Any CPU.ActiveCfg = Release|Any CPU - {23195658-FBE7-4A3E-B79D-91AAC2D428E7}.Release|Any CPU.Build.0 = Release|Any CPU - {FBFBE639-A532-408A-960D-288E05FEEB0E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {FBFBE639-A532-408A-960D-288E05FEEB0E}.Debug|Any CPU.Build.0 = Debug|Any CPU - {FBFBE639-A532-408A-960D-288E05FEEB0E}.Release|Any CPU.ActiveCfg = Release|Any CPU - {FBFBE639-A532-408A-960D-288E05FEEB0E}.Release|Any CPU.Build.0 = Release|Any CPU - {68361F37-56E9-4B49-AFF3-F1AF9938A97F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {68361F37-56E9-4B49-AFF3-F1AF9938A97F}.Debug|Any CPU.Build.0 = Debug|Any CPU - {68361F37-56E9-4B49-AFF3-F1AF9938A97F}.Release|Any CPU.ActiveCfg = Release|Any CPU - {68361F37-56E9-4B49-AFF3-F1AF9938A97F}.Release|Any CPU.Build.0 = Release|Any CPU - {4DE39D59-19C6-4E1E-910C-5EA8BA55348B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {4DE39D59-19C6-4E1E-910C-5EA8BA55348B}.Debug|Any CPU.Build.0 = Debug|Any CPU - {4DE39D59-19C6-4E1E-910C-5EA8BA55348B}.Release|Any CPU.ActiveCfg = Release|Any CPU - {4DE39D59-19C6-4E1E-910C-5EA8BA55348B}.Release|Any CPU.Build.0 = Release|Any CPU - {CFAB82CD-BA17-4F08-99E2-403FADB0C46A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {CFAB82CD-BA17-4F08-99E2-403FADB0C46A}.Debug|Any CPU.Build.0 = Debug|Any CPU - {CFAB82CD-BA17-4F08-99E2-403FADB0C46A}.Release|Any CPU.ActiveCfg = Release|Any CPU - {CFAB82CD-BA17-4F08-99E2-403FADB0C46A}.Release|Any CPU.Build.0 = Release|Any CPU - {C69D27C1-FF4E-43CB-BB0F-9BF811BF0F81}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {C69D27C1-FF4E-43CB-BB0F-9BF811BF0F81}.Debug|Any CPU.Build.0 = Debug|Any CPU - {C69D27C1-FF4E-43CB-BB0F-9BF811BF0F81}.Release|Any CPU.ActiveCfg = Release|Any CPU - {C69D27C1-FF4E-43CB-BB0F-9BF811BF0F81}.Release|Any CPU.Build.0 = Release|Any CPU - {8B843547-F49D-40A2-8C4E-1B81D8C5D589}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {8B843547-F49D-40A2-8C4E-1B81D8C5D589}.Debug|Any CPU.Build.0 = Debug|Any CPU - {8B843547-F49D-40A2-8C4E-1B81D8C5D589}.Release|Any CPU.ActiveCfg = Release|Any CPU - {8B843547-F49D-40A2-8C4E-1B81D8C5D589}.Release|Any CPU.Build.0 = Release|Any CPU - {D0421946-845F-09E8-2545-DE3EB2218254}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {D0421946-845F-09E8-2545-DE3EB2218254}.Debug|Any CPU.Build.0 = Debug|Any CPU - {D0421946-845F-09E8-2545-DE3EB2218254}.Release|Any CPU.ActiveCfg = Release|Any CPU - {D0421946-845F-09E8-2545-DE3EB2218254}.Release|Any CPU.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection - GlobalSection(ExtensibilityGlobals) = postSolution - SolutionGuid = {417600E1-EB0F-4AF6-9C2D-9F542F6AEE7A} - EndGlobalSection -EndGlobal diff --git a/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertVbUsingCSharpRefReturnOnly/VisualBasicUsesCSharpRefReturn/ByRefArgument.cs b/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertVbUsingCSharpRefReturnOnly/VisualBasicUsesCSharpRefReturn/ByRefArgument.cs deleted file mode 100644 index d0bc1dcd2..000000000 --- a/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertVbUsingCSharpRefReturnOnly/VisualBasicUsesCSharpRefReturn/ByRefArgument.cs +++ /dev/null @@ -1,39 +0,0 @@ -using Microsoft.VisualBasic.CompilerServices; - -namespace VisualBasicUsesCSharpRefReturn -{ - public class ByRefArgument - { - public void UseArr() - { - var arrObj = default(object[]); - Modify(ref arrObj[0]); - - var arrInt = default(int[]); - var tmp = arrInt; - object argo = tmp[0]; - Modify(ref argo); - tmp[0] = Conversions.ToInteger(argo); - } - - public void UseRefReturn() - { - var lstObj = default(CSharpRefReturn.RefReturnList); - Modify(ref lstObj[0]); - Modify(ref lstObj.RefProperty); - - var lstInt = default(CSharpRefReturn.RefReturnList); - var tmp = lstInt; - object argo = tmp[0]; - Modify(ref argo); - tmp[0] = Conversions.ToInteger(argo); - object argo1 = lstInt.RefProperty; - Modify(ref argo1); - lstInt.RefProperty = Conversions.ToInteger(argo1); - } - - public void Modify(ref object o) - { - } - } -} \ No newline at end of file diff --git a/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertVbUsingCSharpRefReturnOnly/VisualBasicUsesCSharpRefReturn/My Project/Application.Designer.cs b/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertVbUsingCSharpRefReturnOnly/VisualBasicUsesCSharpRefReturn/My Project/Application.Designer.cs deleted file mode 100644 index 5e9e2a074..000000000 --- a/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertVbUsingCSharpRefReturnOnly/VisualBasicUsesCSharpRefReturn/My Project/Application.Designer.cs +++ /dev/null @@ -1,11 +0,0 @@ -// ------------------------------------------------------------------------------ -// -// This code was generated by a tool. -// Runtime Version:4.0.30319.42000 -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// -// ------------------------------------------------------------------------------ - - diff --git a/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertVbUsingCSharpRefReturnOnly/VisualBasicUsesCSharpRefReturn/My Project/AssemblyInfo.cs b/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertVbUsingCSharpRefReturnOnly/VisualBasicUsesCSharpRefReturn/My Project/AssemblyInfo.cs deleted file mode 100644 index c10fc5b96..000000000 --- a/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertVbUsingCSharpRefReturnOnly/VisualBasicUsesCSharpRefReturn/My Project/AssemblyInfo.cs +++ /dev/null @@ -1,35 +0,0 @@ -using System; -using System.Reflection; -using System.Runtime.InteropServices; - -// 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. - -// Review the values of the assembly attributes - -[assembly: AssemblyTitle("VisualBasicUsesCSharpRefReturn")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("VisualBasicUsesCSharpRefReturn")] -[assembly: AssemblyCopyright("Copyright © 2024")] -[assembly: AssemblyTrademark("")] - -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("47520bc8-6837-4f63-9aef-0a252d368f05")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// 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.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertVbUsingCSharpRefReturnOnly/VisualBasicUsesCSharpRefReturn/My Project/MyNamespace.Static.1.Designer.cs b/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertVbUsingCSharpRefReturnOnly/VisualBasicUsesCSharpRefReturn/My Project/MyNamespace.Static.1.Designer.cs deleted file mode 100644 index 259c509e1..000000000 --- a/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertVbUsingCSharpRefReturnOnly/VisualBasicUsesCSharpRefReturn/My Project/MyNamespace.Static.1.Designer.cs +++ /dev/null @@ -1,468 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. - -using System; -using System.Diagnostics; -using Microsoft.VisualBasic; - -/* TODO ERROR: Skipped IfDirectiveTrivia -#If TARGET = "module" AndAlso _MYTYPE = "" Then -*//* TODO ERROR: Skipped DisabledTextTrivia -#Const _MYTYPE="Empty" -*//* TODO ERROR: Skipped EndIfDirectiveTrivia -#End If -*/ -/* TODO ERROR: Skipped IfDirectiveTrivia -#If _MYTYPE = "WindowsForms" Then -*//* TODO ERROR: Skipped DisabledTextTrivia - -#Const _MYFORMS = True -#Const _MYWEBSERVICES = True -#Const _MYUSERTYPE = "Windows" -#Const _MYCOMPUTERTYPE = "Windows" -#Const _MYAPPLICATIONTYPE = "WindowsForms" - -*//* TODO ERROR: Skipped ElifDirectiveTrivia -#ElseIf _MYTYPE = "WindowsFormsWithCustomSubMain" Then -*//* TODO ERROR: Skipped DisabledTextTrivia - -#Const _MYFORMS = True -#Const _MYWEBSERVICES = True -#Const _MYUSERTYPE = "Windows" -#Const _MYCOMPUTERTYPE = "Windows" -#Const _MYAPPLICATIONTYPE = "Console" - -*//* TODO ERROR: Skipped ElifDirectiveTrivia -#ElseIf _MYTYPE = "Windows" OrElse _MYTYPE = "" Then -*/ -/* TODO ERROR: Skipped DefineDirectiveTrivia -#Const _MYWEBSERVICES = True -*//* TODO ERROR: Skipped DefineDirectiveTrivia -#Const _MYUSERTYPE = "Windows" -*//* TODO ERROR: Skipped DefineDirectiveTrivia -#Const _MYCOMPUTERTYPE = "Windows" -*//* TODO ERROR: Skipped DefineDirectiveTrivia -#Const _MYAPPLICATIONTYPE = "Windows" -*/ -/* TODO ERROR: Skipped ElifDirectiveTrivia -#ElseIf _MYTYPE = "Console" Then -*//* TODO ERROR: Skipped DisabledTextTrivia - -#Const _MYWEBSERVICES = True -#Const _MYUSERTYPE = "Windows" -#Const _MYCOMPUTERTYPE = "Windows" -#Const _MYAPPLICATIONTYPE = "Console" - -*//* TODO ERROR: Skipped ElifDirectiveTrivia -#ElseIf _MYTYPE = "Web" Then -*//* TODO ERROR: Skipped DisabledTextTrivia - -#Const _MYFORMS = False -#Const _MYWEBSERVICES = False -#Const _MYUSERTYPE = "Web" -#Const _MYCOMPUTERTYPE = "Web" - -*//* TODO ERROR: Skipped ElifDirectiveTrivia -#ElseIf _MYTYPE = "WebControl" Then -*//* TODO ERROR: Skipped DisabledTextTrivia - -#Const _MYFORMS = False -#Const _MYWEBSERVICES = True -#Const _MYUSERTYPE = "Web" -#Const _MYCOMPUTERTYPE = "Web" - -*//* TODO ERROR: Skipped ElifDirectiveTrivia -#ElseIf _MYTYPE = "Custom" Then -*//* TODO ERROR: Skipped DisabledTextTrivia - -*//* TODO ERROR: Skipped ElifDirectiveTrivia -#ElseIf _MYTYPE <> "Empty" Then -*//* TODO ERROR: Skipped DisabledTextTrivia - -#Const _MYTYPE = "Empty" - -*//* TODO ERROR: Skipped EndIfDirectiveTrivia -#End If -*/ -/* TODO ERROR: Skipped IfDirectiveTrivia -#If _MYTYPE <> "Empty" Then -*/ -namespace VisualBasicUsesCSharpRefReturn.My -{ - - /* TODO ERROR: Skipped IfDirectiveTrivia - #If _MYAPPLICATIONTYPE = "WindowsForms" OrElse _MYAPPLICATIONTYPE = "Windows" OrElse _MYAPPLICATIONTYPE = "Console" Then - */ - [System.CodeDom.Compiler.GeneratedCode("MyTemplate", "11.0.0.0")] - [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] - - /* TODO ERROR: Skipped IfDirectiveTrivia - #If _MYAPPLICATIONTYPE = "WindowsForms" Then - *//* TODO ERROR: Skipped DisabledTextTrivia - Inherits Global.Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase - #If TARGET = "winexe" Then - _ - Friend Shared Sub Main(ByVal Args As String()) - Try - Global.System.Windows.Forms.Application.SetCompatibleTextRenderingDefault(MyApplication.UseCompatibleTextRendering()) - Finally - End Try - My.Application.Run(Args) - End Sub - #End If - - *//* TODO ERROR: Skipped ElifDirectiveTrivia - #ElseIf _MYAPPLICATIONTYPE = "Windows" Then - */ - internal partial class MyApplication : Microsoft.VisualBasic.ApplicationServices.ApplicationBase - { - /* TODO ERROR: Skipped ElifDirectiveTrivia - #ElseIf _MYAPPLICATIONTYPE = "Console" Then - *//* TODO ERROR: Skipped DisabledTextTrivia - Inherits Global.Microsoft.VisualBasic.ApplicationServices.ConsoleApplicationBase - *//* TODO ERROR: Skipped EndIfDirectiveTrivia - #End If '_MYAPPLICATIONTYPE = "WindowsForms" - */ - } - - /* TODO ERROR: Skipped EndIfDirectiveTrivia - #End If '#If _MYAPPLICATIONTYPE = "WindowsForms" Or _MYAPPLICATIONTYPE = "Windows" or _MYAPPLICATIONTYPE = "Console" - */ - /* TODO ERROR: Skipped IfDirectiveTrivia - #If _MYCOMPUTERTYPE <> "" Then - */ - [System.CodeDom.Compiler.GeneratedCode("MyTemplate", "11.0.0.0")] - [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] - - /* TODO ERROR: Skipped IfDirectiveTrivia - #If _MYCOMPUTERTYPE = "Windows" Then - */ - internal partial class MyComputer : Microsoft.VisualBasic.Devices.Computer - { - /* TODO ERROR: Skipped ElifDirectiveTrivia - #ElseIf _MYCOMPUTERTYPE = "Web" Then - *//* TODO ERROR: Skipped DisabledTextTrivia - Inherits Global.Microsoft.VisualBasic.Devices.ServerComputer - *//* TODO ERROR: Skipped EndIfDirectiveTrivia - #End If - */ - [DebuggerHidden()] - [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] - public MyComputer() : base() - { - } - } - /* TODO ERROR: Skipped EndIfDirectiveTrivia - #End If - */ - [HideModuleName()] - [System.CodeDom.Compiler.GeneratedCode("MyTemplate", "11.0.0.0")] - internal static class MyProject - { - - /* TODO ERROR: Skipped IfDirectiveTrivia - #If _MYCOMPUTERTYPE <> "" Then - */ - [System.ComponentModel.Design.HelpKeyword("My.Computer")] - internal static MyComputer Computer - { - [DebuggerHidden()] - get - { - return m_ComputerObjectProvider.GetInstance; - } - } - - private readonly static ThreadSafeObjectProvider m_ComputerObjectProvider = new ThreadSafeObjectProvider(); - /* TODO ERROR: Skipped EndIfDirectiveTrivia - #End If - */ - /* TODO ERROR: Skipped IfDirectiveTrivia - #If _MYAPPLICATIONTYPE = "Windows" Or _MYAPPLICATIONTYPE = "WindowsForms" Or _MYAPPLICATIONTYPE = "Console" Then - */ - [System.ComponentModel.Design.HelpKeyword("My.Application")] - internal static MyApplication Application - { - [DebuggerHidden()] - get - { - return m_AppObjectProvider.GetInstance; - } - } - private readonly static ThreadSafeObjectProvider m_AppObjectProvider = new ThreadSafeObjectProvider(); - /* TODO ERROR: Skipped EndIfDirectiveTrivia - #End If - */ - /* TODO ERROR: Skipped IfDirectiveTrivia - #If _MYUSERTYPE = "Windows" Then - */ - [System.ComponentModel.Design.HelpKeyword("My.User")] - internal static Microsoft.VisualBasic.ApplicationServices.User User - { - [DebuggerHidden()] - get - { - return m_UserObjectProvider.GetInstance; - } - } - private readonly static ThreadSafeObjectProvider m_UserObjectProvider = new ThreadSafeObjectProvider(); - /* TODO ERROR: Skipped ElifDirectiveTrivia - #ElseIf _MYUSERTYPE = "Web" Then - *//* TODO ERROR: Skipped DisabledTextTrivia - _ - Friend ReadOnly Property User() As Global.Microsoft.VisualBasic.ApplicationServices.WebUser - _ - Get - Return m_UserObjectProvider.GetInstance() - End Get - End Property - Private ReadOnly m_UserObjectProvider As New ThreadSafeObjectProvider(Of Global.Microsoft.VisualBasic.ApplicationServices.WebUser) - *//* TODO ERROR: Skipped EndIfDirectiveTrivia - #End If - */ - /* TODO ERROR: Skipped IfDirectiveTrivia - #If _MYFORMS = True Then - *//* TODO ERROR: Skipped DisabledTextTrivia - - #Const STARTUP_MY_FORM_FACTORY = "My.MyProject.Forms" - - _ - Friend ReadOnly Property Forms() As MyForms - _ - Get - Return m_MyFormsObjectProvider.GetInstance() - End Get - End Property - - _ - _ - Friend NotInheritable Class MyForms - _ - Private Shared Function Create__Instance__(Of T As {New, Global.System.Windows.Forms.Form})(ByVal Instance As T) As T - If Instance Is Nothing OrElse Instance.IsDisposed Then - If m_FormBeingCreated IsNot Nothing Then - If m_FormBeingCreated.ContainsKey(GetType(T)) = True Then - Throw New Global.System.InvalidOperationException(Global.Microsoft.VisualBasic.CompilerServices.Utils.GetResourceString("WinForms_RecursiveFormCreate")) - End If - Else - m_FormBeingCreated = New Global.System.Collections.Hashtable() - End If - m_FormBeingCreated.Add(GetType(T), Nothing) - Try - Return New T() - Catch ex As Global.System.Reflection.TargetInvocationException When ex.InnerException IsNot Nothing - Dim BetterMessage As String = Global.Microsoft.VisualBasic.CompilerServices.Utils.GetResourceString("WinForms_SeeInnerException", ex.InnerException.Message) - Throw New Global.System.InvalidOperationException(BetterMessage, ex.InnerException) - Finally - m_FormBeingCreated.Remove(GetType(T)) - End Try - Else - Return Instance - End If - End Function - - _ - Private Sub Dispose__Instance__(Of T As Global.System.Windows.Forms.Form)(ByRef instance As T) - instance.Dispose() - instance = Nothing - End Sub - - _ - _ - Public Sub New() - MyBase.New() - End Sub - - Private Shared m_FormBeingCreated As Global.System.Collections.Hashtable - - Public Overrides Function Equals(ByVal o As Object) As Boolean - Return MyBase.Equals(o) - End Function - Public Overrides Function GetHashCode() As Integer - Return MyBase.GetHashCode - End Function - _ - Friend Overloads Function [GetType]() As Global.System.Type - Return GetType(MyForms) - End Function - Public Overrides Function ToString() As String - Return MyBase.ToString - End Function - End Class - - Private m_MyFormsObjectProvider As New ThreadSafeObjectProvider(Of MyForms) - - *//* TODO ERROR: Skipped EndIfDirectiveTrivia - #End If - */ - /* TODO ERROR: Skipped IfDirectiveTrivia - #If _MYWEBSERVICES = True Then - */ - [System.ComponentModel.Design.HelpKeyword("My.WebServices")] - internal static MyWebServices WebServices - { - [DebuggerHidden()] - get - { - return m_MyWebServicesObjectProvider.GetInstance; - } - } - - [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] - [MyGroupCollection("System.Web.Services.Protocols.SoapHttpClientProtocol", "Create__Instance__", "Dispose__Instance__", "")] - internal sealed class MyWebServices - { - - [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] - [DebuggerHidden()] - public override bool Equals(object o) - { - return base.Equals(o); - } - [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] - [DebuggerHidden()] - public override int GetHashCode() - { - return base.GetHashCode(); - } - [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] - [DebuggerHidden()] - internal new Type GetType() - { - return typeof(MyWebServices); - } - [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] - [DebuggerHidden()] - public override string ToString() - { - return base.ToString(); - } - - [DebuggerHidden()] - private static T Create__Instance__(T instance) where T : new() - { - if (instance is null) - { - return new T(); - } - else - { - return instance; - } - } - - [DebuggerHidden()] - private void Dispose__Instance__(ref T instance) - { - instance = default(T); - } - - [DebuggerHidden()] - [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] - public MyWebServices() : base() - { - } - } - - private readonly static ThreadSafeObjectProvider m_MyWebServicesObjectProvider = new ThreadSafeObjectProvider(); - /* TODO ERROR: Skipped EndIfDirectiveTrivia - #End If - */ - /* TODO ERROR: Skipped IfDirectiveTrivia - #If _MYTYPE = "Web" Then - *//* TODO ERROR: Skipped DisabledTextTrivia - - _ - Friend ReadOnly Property Request() As Global.System.Web.HttpRequest - _ - Get - Dim CurrentContext As Global.System.Web.HttpContext = Global.System.Web.HttpContext.Current - If CurrentContext IsNot Nothing Then - Return CurrentContext.Request - End If - Return Nothing - End Get - End Property - - _ - Friend ReadOnly Property Response() As Global.System.Web.HttpResponse - _ - Get - Dim CurrentContext As Global.System.Web.HttpContext = Global.System.Web.HttpContext.Current - If CurrentContext IsNot Nothing Then - Return CurrentContext.Response - End If - Return Nothing - End Get - End Property - - _ - Friend ReadOnly Property Log() As Global.Microsoft.VisualBasic.Logging.AspLog - _ - Get - Return m_LogObjectProvider.GetInstance() - End Get - End Property - - Private ReadOnly m_LogObjectProvider As New ThreadSafeObjectProvider(Of Global.Microsoft.VisualBasic.Logging.AspLog) - - *//* TODO ERROR: Skipped EndIfDirectiveTrivia - #End If '_MYTYPE="Web" - */ - [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] - [System.Runtime.InteropServices.ComVisible(false)] - internal sealed class ThreadSafeObjectProvider where T : new() - { - internal T GetInstance - { - /* TODO ERROR: Skipped IfDirectiveTrivia - #If TARGET = "library" Then - */ - [DebuggerHidden()] - get - { - var Value = m_Context.Value; - if (Value is null) - { - Value = new T(); - m_Context.Value = Value; - } - return Value; - } - /* TODO ERROR: Skipped ElseDirectiveTrivia - #Else - *//* TODO ERROR: Skipped DisabledTextTrivia - _ - Get - If m_ThreadStaticValue Is Nothing Then m_ThreadStaticValue = New T - Return m_ThreadStaticValue - End Get - *//* TODO ERROR: Skipped EndIfDirectiveTrivia - #End If - */ - } - - [DebuggerHidden()] - [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] - public ThreadSafeObjectProvider() : base() - { - } - - /* TODO ERROR: Skipped IfDirectiveTrivia - #If TARGET = "library" Then - */ - private readonly Microsoft.VisualBasic.MyServices.Internal.ContextValue m_Context = new Microsoft.VisualBasic.MyServices.Internal.ContextValue(); - /* TODO ERROR: Skipped ElseDirectiveTrivia - #Else - *//* TODO ERROR: Skipped DisabledTextTrivia - Private Shared m_ThreadStaticValue As T - *//* TODO ERROR: Skipped EndIfDirectiveTrivia - #End If - */ - } - } -} -/* TODO ERROR: Skipped EndIfDirectiveTrivia -#End If -*/ \ No newline at end of file diff --git a/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertVbUsingCSharpRefReturnOnly/VisualBasicUsesCSharpRefReturn/My Project/MyNamespace.Static.2.Designer.cs b/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertVbUsingCSharpRefReturnOnly/VisualBasicUsesCSharpRefReturn/My Project/MyNamespace.Static.2.Designer.cs deleted file mode 100644 index 01e385026..000000000 --- a/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertVbUsingCSharpRefReturnOnly/VisualBasicUsesCSharpRefReturn/My Project/MyNamespace.Static.2.Designer.cs +++ /dev/null @@ -1,242 +0,0 @@ -using System.Collections; -using System.Collections.Generic; -using System.Data; -using System.Diagnostics; -using System.Linq; -using System.Xml.Linq; -using Microsoft.VisualBasic; -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. - -// See Compiler::LoadXmlSolutionExtension -namespace VisualBasicUsesCSharpRefReturn.My -{ - [Embedded()] - [DebuggerNonUserCode()] - [System.Runtime.CompilerServices.CompilerGenerated()] - [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] - internal sealed class InternalXmlHelper - { - [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] - private InternalXmlHelper() - { - } - public static string get_Value(IEnumerable source) - { - foreach (XElement item in source) - return item.Value; - return null; - } - - public static void set_Value(IEnumerable source, string value) - { - foreach (XElement item in source) - { - item.Value = value; - break; - } - } - public static string get_AttributeValue(IEnumerable source, XName name) - { - foreach (XElement item in source) - return (string)item.Attribute(name); - return null; - } - - public static void set_AttributeValue(IEnumerable source, XName name, string value) - { - foreach (XElement item in source) - { - item.SetAttributeValue(name, value); - break; - } - } - public static string get_AttributeValue(XElement source, XName name) - { - return (string)source.Attribute(name); - } - - public static void set_AttributeValue(XElement source, XName name, string value) - { - source.SetAttributeValue(name, value); - } - [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] - public static XAttribute CreateAttribute(XName name, object value) - { - if (value is null) - { - return null; - } - return new XAttribute(name, value); - } - [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] - public static XAttribute CreateNamespaceAttribute(XName name, XNamespace ns) - { - var a = new XAttribute(name, ns.NamespaceName); - a.AddAnnotation(ns); - return a; - } - [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] - public static object RemoveNamespaceAttributes(string[] inScopePrefixes, XNamespace[] inScopeNs, List attributes, object obj) - { - if (obj is not null) - { - XElement elem = obj as XElement; - if (elem is not null) - { - return RemoveNamespaceAttributes(inScopePrefixes, inScopeNs, attributes, elem); - } - else - { - IEnumerable elems = obj as IEnumerable; - if (elems is not null) - { - return RemoveNamespaceAttributes(inScopePrefixes, inScopeNs, attributes, elems); - } - } - } - return obj; - } - [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] - public static IEnumerable RemoveNamespaceAttributes(string[] inScopePrefixes, XNamespace[] inScopeNs, List attributes, IEnumerable obj) - { - if (obj is not null) - { - IEnumerable elems = obj as IEnumerable; - if (elems is not null) - { - return elems.Select(new RemoveNamespaceAttributesClosure(inScopePrefixes, inScopeNs, attributes).ProcessXElement); - } - else - { - return obj.Cast().Select(new RemoveNamespaceAttributesClosure(inScopePrefixes, inScopeNs, attributes).ProcessObject); - } - } - return obj; - } - [DebuggerNonUserCode()] - [System.Runtime.CompilerServices.CompilerGenerated()] - [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] - private sealed class RemoveNamespaceAttributesClosure - { - private readonly string[] m_inScopePrefixes; - private readonly XNamespace[] m_inScopeNs; - private readonly List m_attributes; - [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] - internal RemoveNamespaceAttributesClosure(string[] inScopePrefixes, XNamespace[] inScopeNs, List attributes) - { - m_inScopePrefixes = inScopePrefixes; - m_inScopeNs = inScopeNs; - m_attributes = attributes; - } - [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] - internal XElement ProcessXElement(XElement elem) - { - return RemoveNamespaceAttributes(m_inScopePrefixes, m_inScopeNs, m_attributes, elem); - } - [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] - internal object ProcessObject(object obj) - { - XElement elem = obj as XElement; - if (elem is not null) - { - return RemoveNamespaceAttributes(m_inScopePrefixes, m_inScopeNs, m_attributes, elem); - } - else - { - return obj; - } - } - } - [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] - public static XElement RemoveNamespaceAttributes(string[] inScopePrefixes, XNamespace[] inScopeNs, List attributes, XElement e) - { - if (e is not null) - { - var a = e.FirstAttribute; - - while (a is not null) - { - var nextA = a.NextAttribute; - - if (a.IsNamespaceDeclaration) - { - var ns = a.Annotation(); - string prefix = a.Name.LocalName; - - if (ns is not null) - { - if (inScopePrefixes is not null && inScopeNs is not null) - { - int lastIndex = inScopePrefixes.Length - 1; - - for (int i = 0, loopTo = lastIndex; i <= loopTo; i++) - { - string currentInScopePrefix = inScopePrefixes[i]; - var currentInScopeNs = inScopeNs[i]; - if (prefix.Equals(currentInScopePrefix)) - { - if (ns == currentInScopeNs) - { - // prefix and namespace match. Remove the unneeded ns attribute - a.Remove(); - } - - // prefix is in scope but refers to something else. Leave the ns attribute. - a = null; - break; - } - } - } - - if (a is not null) - { - // Prefix is not in scope - // Now check whether it's going to be in scope because it is in the attributes list - - if (attributes is not null) - { - int lastIndex = attributes.Count - 1; - for (int i = 0, loopTo1 = lastIndex; i <= loopTo1; i++) - { - var currentA = attributes[i]; - string currentInScopePrefix = currentA.Name.LocalName; - var currentInScopeNs = currentA.Annotation(); - if (currentInScopeNs is not null) - { - if (prefix.Equals(currentInScopePrefix)) - { - if (ns == currentInScopeNs) - { - // prefix and namespace match. Remove the unneeded ns attribute - a.Remove(); - } - - // prefix is in scope but refers to something else. Leave the ns attribute. - a = null; - break; - } - } - } - } - - if (a is not null) - { - // Prefix is definitely not in scope - a.Remove(); - // namespace is not defined either. Add this attributes list - attributes.Add(a); - } - } - } - } - - a = nextA; - } - } - return e; - } - - } -} \ No newline at end of file diff --git a/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertVbUsingCSharpRefReturnOnly/VisualBasicUsesCSharpRefReturn/My Project/MyNamespace.Static.3.Designer.cs b/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertVbUsingCSharpRefReturnOnly/VisualBasicUsesCSharpRefReturn/My Project/MyNamespace.Static.3.Designer.cs deleted file mode 100644 index e39b42043..000000000 --- a/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertVbUsingCSharpRefReturnOnly/VisualBasicUsesCSharpRefReturn/My Project/MyNamespace.Static.3.Designer.cs +++ /dev/null @@ -1,16 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. - -using System; - -namespace Microsoft.VisualBasic -{ - [Embedded()] - [AttributeUsage(AttributeTargets.Class | AttributeTargets.Module | AttributeTargets.Assembly, Inherited = false)] - [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] - [System.Runtime.CompilerServices.CompilerGenerated()] - internal sealed class Embedded : Attribute - { - } -} \ No newline at end of file diff --git a/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertVbUsingCSharpRefReturnOnly/VisualBasicUsesCSharpRefReturn/My Project/Settings.Designer.cs b/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertVbUsingCSharpRefReturnOnly/VisualBasicUsesCSharpRefReturn/My Project/Settings.Designer.cs deleted file mode 100644 index 4023833b9..000000000 --- a/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertVbUsingCSharpRefReturnOnly/VisualBasicUsesCSharpRefReturn/My Project/Settings.Designer.cs +++ /dev/null @@ -1,88 +0,0 @@ -// ------------------------------------------------------------------------------ -// -// This code was generated by a tool. -// Runtime Version:4.0.30319.42000 -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// -// ------------------------------------------------------------------------------ - -using System.Diagnostics; -using Microsoft.VisualBasic; - - -namespace VisualBasicUsesCSharpRefReturn.My -{ - - [System.Runtime.CompilerServices.CompilerGenerated()] - [System.CodeDom.Compiler.GeneratedCode("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")] - [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Advanced)] - internal sealed partial class MySettings : System.Configuration.ApplicationSettingsBase - { - - private static MySettings defaultInstance = (MySettings)Synchronized(new MySettings()); - - #region My.Settings Auto-Save Functionality - /* TODO ERROR: Skipped IfDirectiveTrivia - #If _MyType = "WindowsForms" Then - *//* TODO ERROR: Skipped DisabledTextTrivia - Private Shared addedHandler As Boolean - - Private Shared addedHandlerLockObject As New Object - - _ - Private Shared Sub AutoSaveSettings(ByVal sender As Global.System.Object, ByVal e As Global.System.EventArgs) - If My.Application.SaveMySettingsOnExit Then - My.Settings.Save() - End If - End Sub - *//* TODO ERROR: Skipped EndIfDirectiveTrivia - #End If - */ - #endregion - - public static MySettings Default - { - get - { - - /* TODO ERROR: Skipped IfDirectiveTrivia - #If _MyType = "WindowsForms" Then - *//* TODO ERROR: Skipped DisabledTextTrivia - If Not addedHandler Then - SyncLock addedHandlerLockObject - If Not addedHandler Then - AddHandler My.Application.Shutdown, AddressOf AutoSaveSettings - addedHandler = True - End If - End SyncLock - End If - *//* TODO ERROR: Skipped EndIfDirectiveTrivia - #End If - */ - return defaultInstance; - } - } - } -} - -namespace VisualBasicUsesCSharpRefReturn.My -{ - - [HideModuleName()] - [DebuggerNonUserCode()] - [System.Runtime.CompilerServices.CompilerGenerated()] - internal static class MySettingsProperty - { - - [System.ComponentModel.Design.HelpKeyword("My.Settings")] - internal static MySettings Settings - { - get - { - return MySettings.Default; - } - } - } -} \ No newline at end of file diff --git a/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertVbUsingCSharpRefReturnOnly/VisualBasicUsesCSharpRefReturn/Resources.Designer.cs b/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertVbUsingCSharpRefReturnOnly/VisualBasicUsesCSharpRefReturn/Resources.Designer.cs deleted file mode 100644 index 480dcb9a8..000000000 --- a/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertVbUsingCSharpRefReturnOnly/VisualBasicUsesCSharpRefReturn/Resources.Designer.cs +++ /dev/null @@ -1,70 +0,0 @@ -// ------------------------------------------------------------------------------ -// -// This code was generated by a tool. -// Runtime Version:4.0.30319.42000 -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// -// ------------------------------------------------------------------------------ - -using System.Diagnostics; -using Microsoft.VisualBasic; - - -namespace VisualBasicUsesCSharpRefReturn.My.Resources -{ - - // This class was auto-generated by the StronglyTypedResourceBuilder - // class via a tool like ResGen or Visual Studio. - // To add or remove a member, edit your .ResX file then rerun ResGen - // with the /str option, or rebuild your VS project. - /// - /// A strongly-typed resource class, for looking up localized strings, etc. - /// - [System.CodeDom.Compiler.GeneratedCode("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] - [DebuggerNonUserCode()] - [System.Runtime.CompilerServices.CompilerGenerated()] - [HideModuleName()] - internal static class Resources - { - - private static System.Resources.ResourceManager resourceMan; - - private static System.Globalization.CultureInfo resourceCulture; - - /// - /// Returns the cached ResourceManager instance used by this class. - /// - [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Advanced)] - internal static System.Resources.ResourceManager ResourceManager - { - get - { - if (ReferenceEquals(resourceMan, null)) - { - var temp = new System.Resources.ResourceManager("VisualBasicUsesCSharpRefReturn.Resources", typeof(Resources).Assembly); - resourceMan = temp; - } - return resourceMan; - } - } - - /// - /// Overrides the current thread's CurrentUICulture property for all - /// resource lookups using this strongly typed resource class. - /// - [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Advanced)] - internal static System.Globalization.CultureInfo Culture - { - get - { - return resourceCulture; - } - set - { - resourceCulture = value; - } - } - } -} \ No newline at end of file diff --git a/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertVbUsingCSharpRefReturnOnly/VisualBasicUsesCSharpRefReturn/VisualBasicUsingCSharpRefReturn.csproj b/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertVbUsingCSharpRefReturnOnly/VisualBasicUsesCSharpRefReturn/VisualBasicUsingCSharpRefReturn.csproj deleted file mode 100644 index 8b2a8df24..000000000 --- a/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertVbUsingCSharpRefReturnOnly/VisualBasicUsesCSharpRefReturn/VisualBasicUsingCSharpRefReturn.csproj +++ /dev/null @@ -1,115 +0,0 @@ - - - - - Debug - AnyCPU - {D0421946-845F-09E8-2545-DE3EB2218254} - Library - VisualBasicUsesCSharpRefReturn - VisualBasicUsesCSharpRefReturn - 512 - Windows - v4.8 - true - $(DefaultItemExcludes);$(ProjectDir)**\*.vb - latest - - - true - full - bin\Debug\ - bin\Debug\VisualBasicUsesCSharpRefReturn.xml - 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022 - TRACE;DEBUG - - - pdbonly - true - bin\Release\ - bin\Release\VisualBasicUsesCSharpRefReturn.xml - 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022 - TRACE - - - On - - - Binary - - - Off - - - On - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - True - Application.myapp - - - True - True - Resources.resx - - - True - Settings.settings - True - - - - - - ResXFileCodeGenerator - Resources.Designer.cs - VisualBasicUsesCSharpRefReturn.My.Resources - Designer - - - - - MyApplicationCodeGenerator - Application.Designer.cs - - - SettingsSingleFileGenerator - VisualBasicUsesCSharpRefReturn.My - Settings.Designer.cs - - - - - {8b843547-f49d-40a2-8c4e-1b81d8c5d589} - CSharpRefReturn - - - - \ No newline at end of file diff --git a/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertVbUsingCSharpRefReturnOnly/VisualBasicUsesCSharpRefReturn/WithRefReturnStructure.cs b/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertVbUsingCSharpRefReturnOnly/VisualBasicUsesCSharpRefReturn/WithRefReturnStructure.cs deleted file mode 100644 index 64b3cd197..000000000 --- a/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertVbUsingCSharpRefReturnOnly/VisualBasicUsesCSharpRefReturn/WithRefReturnStructure.cs +++ /dev/null @@ -1,41 +0,0 @@ - -namespace VisualBasicUsesCSharpRefReturn -{ - public class WithRefReturnStructure - { - public void UseArr() - { - var arr = default(SomeStruct[]); - var s = default(string); - - { - ref var withBlock = ref arr[0]; - withBlock.P = s; - s = withBlock.P; - } - } - - public void UseRefReturn() - { - var lst = default(CSharpRefReturn.RefReturnList); - var s = default(string); - - { - ref var withBlock = ref lst[0]; - withBlock.P = s; - s = withBlock.P; - } - - { - ref var withBlock1 = ref lst.RefProperty; - withBlock1.P = s; - s = withBlock1.P; - } - } - - public struct SomeStruct - { - public string P { get; set; } - } - } -} \ No newline at end of file diff --git a/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/CharacterizationTestSolution.sln b/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/CharacterizationTestSolution.sln index 364b36658..cd9da7bc3 100644 --- a/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/CharacterizationTestSolution.sln +++ b/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/CharacterizationTestSolution.sln @@ -1,10 +1,8 @@ Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio Version 17 -VisualStudioVersion = 17.9.34321.82 +# Visual Studio Version 18 +VisualStudioVersion = 18.0.11205.157 MinimumVisualStudioVersion = 10.0.40219.1 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WindowsAppVb", "WindowsAppVb\WindowsAppVb.csproj", "{63AE39F6-D4CF-0888-2B6F-3EF803778218}" -EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CSharpConsoleApp", "ConsoleApp2\CSharpConsoleApp.csproj", "{B7602E54-8F45-4DC4-88B5-E11CDC7E8B41}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "NetCore", "NetCore\NetCore.csproj", "{73BF583C-DD55-486C-9D0F-15D3D8CC72D9}" @@ -24,7 +22,9 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CSharpNetStandardLib", "CSh EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Prefix.VbLibrary", "Prefix.VbLibrary\Prefix.VbLibrary.csproj", "{7D8F03A6-764F-00F9-1BBA-8A41CF27F0CA}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "VisualBasicConsoleApp", "ConsoleApp1\VisualBasicConsoleApp.csproj", "{74B9A6AA-3316-0C3A-3957-518673283B21}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WinFormsAppVb", "WinFormsAppVb\WinFormsAppVb.csproj", "{8B61DE53-8DCF-03CB-3928-841A18C4BF1E}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "VisualBasicConsoleApp", "VisualBasicConsoleApp\VisualBasicConsoleApp.csproj", "{705CCDE1-E790-0587-3FB4-662796892C34}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -32,10 +32,6 @@ Global Release|Any CPU = Release|Any CPU EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution - {63AE39F6-D4CF-0888-2B6F-3EF803778218}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {63AE39F6-D4CF-0888-2B6F-3EF803778218}.Debug|Any CPU.Build.0 = Debug|Any CPU - {63AE39F6-D4CF-0888-2B6F-3EF803778218}.Release|Any CPU.ActiveCfg = Release|Any CPU - {63AE39F6-D4CF-0888-2B6F-3EF803778218}.Release|Any CPU.Build.0 = Release|Any CPU {B7602E54-8F45-4DC4-88B5-E11CDC7E8B41}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {B7602E54-8F45-4DC4-88B5-E11CDC7E8B41}.Debug|Any CPU.Build.0 = Debug|Any CPU {B7602E54-8F45-4DC4-88B5-E11CDC7E8B41}.Release|Any CPU.ActiveCfg = Release|Any CPU @@ -64,10 +60,14 @@ Global {7D8F03A6-764F-00F9-1BBA-8A41CF27F0CA}.Debug|Any CPU.Build.0 = Debug|Any CPU {7D8F03A6-764F-00F9-1BBA-8A41CF27F0CA}.Release|Any CPU.ActiveCfg = Release|Any CPU {7D8F03A6-764F-00F9-1BBA-8A41CF27F0CA}.Release|Any CPU.Build.0 = Release|Any CPU - {74B9A6AA-3316-0C3A-3957-518673283B21}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {74B9A6AA-3316-0C3A-3957-518673283B21}.Debug|Any CPU.Build.0 = Debug|Any CPU - {74B9A6AA-3316-0C3A-3957-518673283B21}.Release|Any CPU.ActiveCfg = Release|Any CPU - {74B9A6AA-3316-0C3A-3957-518673283B21}.Release|Any CPU.Build.0 = Release|Any CPU + {8B61DE53-8DCF-03CB-3928-841A18C4BF1E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {8B61DE53-8DCF-03CB-3928-841A18C4BF1E}.Debug|Any CPU.Build.0 = Debug|Any CPU + {8B61DE53-8DCF-03CB-3928-841A18C4BF1E}.Release|Any CPU.ActiveCfg = Release|Any CPU + {8B61DE53-8DCF-03CB-3928-841A18C4BF1E}.Release|Any CPU.Build.0 = Release|Any CPU + {705CCDE1-E790-0587-3FB4-662796892C34}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {705CCDE1-E790-0587-3FB4-662796892C34}.Debug|Any CPU.Build.0 = Debug|Any CPU + {705CCDE1-E790-0587-3FB4-662796892C34}.Release|Any CPU.ActiveCfg = Release|Any CPU + {705CCDE1-E790-0587-3FB4-662796892C34}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/ConsoleApp1/My Project/Application.Designer.cs b/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/ConsoleApp1/My Project/Application.Designer.cs deleted file mode 100644 index 3d3b640fe..000000000 --- a/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/ConsoleApp1/My Project/Application.Designer.cs +++ /dev/null @@ -1,11 +0,0 @@ -// ------------------------------------------------------------------------------ -// -// This code was generated by a tool. -// Runtime Version:4.0.30319.42000 -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// -// ------------------------------------------------------------------------------ - - diff --git a/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/ConsoleApp1/My Project/AssemblyInfo.cs b/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/ConsoleApp1/My Project/AssemblyInfo.cs deleted file mode 100644 index 896d5d011..000000000 --- a/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/ConsoleApp1/My Project/AssemblyInfo.cs +++ /dev/null @@ -1,35 +0,0 @@ -using System; -using System.Reflection; -using System.Runtime.InteropServices; - -// 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. - -// Review the values of the assembly attributes - -[assembly: AssemblyTitle("ConsoleApp1")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("ConsoleApp1")] -[assembly: AssemblyCopyright("Copyright © 2018")] -[assembly: AssemblyTrademark("")] - -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("3130b95d-a38c-416f-a353-cd75539cbe19")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// 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.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/ConsoleApp1/My Project/MyNamespace.Static.1.Designer.cs b/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/ConsoleApp1/My Project/MyNamespace.Static.1.Designer.cs deleted file mode 100644 index d2885eb08..000000000 --- a/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/ConsoleApp1/My Project/MyNamespace.Static.1.Designer.cs +++ /dev/null @@ -1,470 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. - -using System; -using System.Diagnostics; -using Microsoft.VisualBasic; - -/* TODO ERROR: Skipped IfDirectiveTrivia -#If TARGET = "module" AndAlso _MYTYPE = "" Then -*//* TODO ERROR: Skipped DisabledTextTrivia -#Const _MYTYPE="Empty" -*//* TODO ERROR: Skipped EndIfDirectiveTrivia -#End If -*/ -/* TODO ERROR: Skipped IfDirectiveTrivia -#If _MYTYPE = "WindowsForms" Then -*//* TODO ERROR: Skipped DisabledTextTrivia - -#Const _MYFORMS = True -#Const _MYWEBSERVICES = True -#Const _MYUSERTYPE = "Windows" -#Const _MYCOMPUTERTYPE = "Windows" -#Const _MYAPPLICATIONTYPE = "WindowsForms" - -*//* TODO ERROR: Skipped ElifDirectiveTrivia -#ElseIf _MYTYPE = "WindowsFormsWithCustomSubMain" Then -*//* TODO ERROR: Skipped DisabledTextTrivia - -#Const _MYFORMS = True -#Const _MYWEBSERVICES = True -#Const _MYUSERTYPE = "Windows" -#Const _MYCOMPUTERTYPE = "Windows" -#Const _MYAPPLICATIONTYPE = "Console" - -*//* TODO ERROR: Skipped ElifDirectiveTrivia -#ElseIf _MYTYPE = "Windows" OrElse _MYTYPE = "" Then -*//* TODO ERROR: Skipped DisabledTextTrivia - -#Const _MYWEBSERVICES = True -#Const _MYUSERTYPE = "Windows" -#Const _MYCOMPUTERTYPE = "Windows" -#Const _MYAPPLICATIONTYPE = "Windows" - -*//* TODO ERROR: Skipped ElifDirectiveTrivia -#ElseIf _MYTYPE = "Console" Then -*/ -/* TODO ERROR: Skipped DefineDirectiveTrivia -#Const _MYWEBSERVICES = True -*//* TODO ERROR: Skipped DefineDirectiveTrivia -#Const _MYUSERTYPE = "Windows" -*//* TODO ERROR: Skipped DefineDirectiveTrivia -#Const _MYCOMPUTERTYPE = "Windows" -*//* TODO ERROR: Skipped DefineDirectiveTrivia -#Const _MYAPPLICATIONTYPE = "Console" -*/ -/* TODO ERROR: Skipped ElifDirectiveTrivia -#ElseIf _MYTYPE = "Web" Then -*//* TODO ERROR: Skipped DisabledTextTrivia - -#Const _MYFORMS = False -#Const _MYWEBSERVICES = False -#Const _MYUSERTYPE = "Web" -#Const _MYCOMPUTERTYPE = "Web" - -*//* TODO ERROR: Skipped ElifDirectiveTrivia -#ElseIf _MYTYPE = "WebControl" Then -*//* TODO ERROR: Skipped DisabledTextTrivia - -#Const _MYFORMS = False -#Const _MYWEBSERVICES = True -#Const _MYUSERTYPE = "Web" -#Const _MYCOMPUTERTYPE = "Web" - -*//* TODO ERROR: Skipped ElifDirectiveTrivia -#ElseIf _MYTYPE = "Custom" Then -*//* TODO ERROR: Skipped DisabledTextTrivia - -*//* TODO ERROR: Skipped ElifDirectiveTrivia -#ElseIf _MYTYPE <> "Empty" Then -*//* TODO ERROR: Skipped DisabledTextTrivia - -#Const _MYTYPE = "Empty" - -*//* TODO ERROR: Skipped EndIfDirectiveTrivia -#End If -*/ -/* TODO ERROR: Skipped IfDirectiveTrivia -#If _MYTYPE <> "Empty" Then -*/ -namespace ConsoleApp1.My -{ - - /* TODO ERROR: Skipped IfDirectiveTrivia - #If _MYAPPLICATIONTYPE = "WindowsForms" OrElse _MYAPPLICATIONTYPE = "Windows" OrElse _MYAPPLICATIONTYPE = "Console" Then - */ - [System.CodeDom.Compiler.GeneratedCode("MyTemplate", "11.0.0.0")] - [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] - - /* TODO ERROR: Skipped IfDirectiveTrivia - #If _MYAPPLICATIONTYPE = "WindowsForms" Then - *//* TODO ERROR: Skipped DisabledTextTrivia - Inherits Global.Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase - #If TARGET = "winexe" Then - _ - Friend Shared Sub Main(ByVal Args As String()) - Try - Global.System.Windows.Forms.Application.SetCompatibleTextRenderingDefault(MyApplication.UseCompatibleTextRendering()) - Finally - End Try - My.Application.Run(Args) - End Sub - #End If - - *//* TODO ERROR: Skipped ElifDirectiveTrivia - #ElseIf _MYAPPLICATIONTYPE = "Windows" Then - *//* TODO ERROR: Skipped DisabledTextTrivia - Inherits Global.Microsoft.VisualBasic.ApplicationServices.ApplicationBase - *//* TODO ERROR: Skipped ElifDirectiveTrivia - #ElseIf _MYAPPLICATIONTYPE = "Console" Then - */ - internal partial class MyApplication : Microsoft.VisualBasic.ApplicationServices.ConsoleApplicationBase - { - /* TODO ERROR: Skipped EndIfDirectiveTrivia - #End If '_MYAPPLICATIONTYPE = "WindowsForms" - */ - } - - /* TODO ERROR: Skipped EndIfDirectiveTrivia - #End If '#If _MYAPPLICATIONTYPE = "WindowsForms" Or _MYAPPLICATIONTYPE = "Windows" or _MYAPPLICATIONTYPE = "Console" - */ - /* TODO ERROR: Skipped IfDirectiveTrivia - #If _MYCOMPUTERTYPE <> "" Then - */ - [System.CodeDom.Compiler.GeneratedCode("MyTemplate", "11.0.0.0")] - [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] - - /* TODO ERROR: Skipped IfDirectiveTrivia - #If _MYCOMPUTERTYPE = "Windows" Then - */ - internal partial class MyComputer : Microsoft.VisualBasic.Devices.Computer - { - /* TODO ERROR: Skipped ElifDirectiveTrivia - #ElseIf _MYCOMPUTERTYPE = "Web" Then - *//* TODO ERROR: Skipped DisabledTextTrivia - Inherits Global.Microsoft.VisualBasic.Devices.ServerComputer - *//* TODO ERROR: Skipped EndIfDirectiveTrivia - #End If - */ - [DebuggerHidden()] - [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] - public MyComputer() : base() - { - } - } - /* TODO ERROR: Skipped EndIfDirectiveTrivia - #End If - */ - [HideModuleName()] - [System.CodeDom.Compiler.GeneratedCode("MyTemplate", "11.0.0.0")] - internal static class MyProject - { - - /* TODO ERROR: Skipped IfDirectiveTrivia - #If _MYCOMPUTERTYPE <> "" Then - */ - [System.ComponentModel.Design.HelpKeyword("My.Computer")] - internal static MyComputer Computer - { - [DebuggerHidden()] - get - { - return m_ComputerObjectProvider.GetInstance; - } - } - - private readonly static ThreadSafeObjectProvider m_ComputerObjectProvider = new ThreadSafeObjectProvider(); - /* TODO ERROR: Skipped EndIfDirectiveTrivia - #End If - */ - /* TODO ERROR: Skipped IfDirectiveTrivia - #If _MYAPPLICATIONTYPE = "Windows" Or _MYAPPLICATIONTYPE = "WindowsForms" Or _MYAPPLICATIONTYPE = "Console" Then - */ - [System.ComponentModel.Design.HelpKeyword("My.Application")] - internal static MyApplication Application - { - [DebuggerHidden()] - get - { - return m_AppObjectProvider.GetInstance; - } - } - private readonly static ThreadSafeObjectProvider m_AppObjectProvider = new ThreadSafeObjectProvider(); - /* TODO ERROR: Skipped EndIfDirectiveTrivia - #End If - */ - /* TODO ERROR: Skipped IfDirectiveTrivia - #If _MYUSERTYPE = "Windows" Then - */ - [System.ComponentModel.Design.HelpKeyword("My.User")] - internal static Microsoft.VisualBasic.ApplicationServices.User User - { - [DebuggerHidden()] - get - { - return m_UserObjectProvider.GetInstance; - } - } - private readonly static ThreadSafeObjectProvider m_UserObjectProvider = new ThreadSafeObjectProvider(); - /* TODO ERROR: Skipped ElifDirectiveTrivia - #ElseIf _MYUSERTYPE = "Web" Then - *//* TODO ERROR: Skipped DisabledTextTrivia - _ - Friend ReadOnly Property User() As Global.Microsoft.VisualBasic.ApplicationServices.WebUser - _ - Get - Return m_UserObjectProvider.GetInstance() - End Get - End Property - Private ReadOnly m_UserObjectProvider As New ThreadSafeObjectProvider(Of Global.Microsoft.VisualBasic.ApplicationServices.WebUser) - *//* TODO ERROR: Skipped EndIfDirectiveTrivia - #End If - */ - /* TODO ERROR: Skipped IfDirectiveTrivia - #If _MYFORMS = True Then - *//* TODO ERROR: Skipped DisabledTextTrivia - - #Const STARTUP_MY_FORM_FACTORY = "My.MyProject.Forms" - - _ - Friend ReadOnly Property Forms() As MyForms - _ - Get - Return m_MyFormsObjectProvider.GetInstance() - End Get - End Property - - _ - _ - Friend NotInheritable Class MyForms - _ - Private Shared Function Create__Instance__(Of T As {New, Global.System.Windows.Forms.Form})(ByVal Instance As T) As T - If Instance Is Nothing OrElse Instance.IsDisposed Then - If m_FormBeingCreated IsNot Nothing Then - If m_FormBeingCreated.ContainsKey(GetType(T)) = True Then - Throw New Global.System.InvalidOperationException(Global.Microsoft.VisualBasic.CompilerServices.Utils.GetResourceString("WinForms_RecursiveFormCreate")) - End If - Else - m_FormBeingCreated = New Global.System.Collections.Hashtable() - End If - m_FormBeingCreated.Add(GetType(T), Nothing) - Try - Return New T() - Catch ex As Global.System.Reflection.TargetInvocationException When ex.InnerException IsNot Nothing - Dim BetterMessage As String = Global.Microsoft.VisualBasic.CompilerServices.Utils.GetResourceString("WinForms_SeeInnerException", ex.InnerException.Message) - Throw New Global.System.InvalidOperationException(BetterMessage, ex.InnerException) - Finally - m_FormBeingCreated.Remove(GetType(T)) - End Try - Else - Return Instance - End If - End Function - - _ - Private Sub Dispose__Instance__(Of T As Global.System.Windows.Forms.Form)(ByRef instance As T) - instance.Dispose() - instance = Nothing - End Sub - - _ - _ - Public Sub New() - MyBase.New() - End Sub - - Private Shared m_FormBeingCreated As Global.System.Collections.Hashtable - - Public Overrides Function Equals(ByVal o As Object) As Boolean - Return MyBase.Equals(o) - End Function - Public Overrides Function GetHashCode() As Integer - Return MyBase.GetHashCode - End Function - _ - Friend Overloads Function [GetType]() As Global.System.Type - Return GetType(MyForms) - End Function - Public Overrides Function ToString() As String - Return MyBase.ToString - End Function - End Class - - Private m_MyFormsObjectProvider As New ThreadSafeObjectProvider(Of MyForms) - - *//* TODO ERROR: Skipped EndIfDirectiveTrivia - #End If - */ - /* TODO ERROR: Skipped IfDirectiveTrivia - #If _MYWEBSERVICES = True Then - */ - [System.ComponentModel.Design.HelpKeyword("My.WebServices")] - internal static MyWebServices WebServices - { - [DebuggerHidden()] - get - { - return m_MyWebServicesObjectProvider.GetInstance; - } - } - - [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] - [MyGroupCollection("System.Web.Services.Protocols.SoapHttpClientProtocol", "Create__Instance__", "Dispose__Instance__", "")] - internal sealed class MyWebServices - { - - [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] - [DebuggerHidden()] - public override bool Equals(object o) - { - return base.Equals(o); - } - [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] - [DebuggerHidden()] - public override int GetHashCode() - { - return base.GetHashCode(); - } - [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] - [DebuggerHidden()] - internal new Type GetType() - { - return typeof(MyWebServices); - } - [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] - [DebuggerHidden()] - public override string ToString() - { - return base.ToString(); - } - - [DebuggerHidden()] - private static T Create__Instance__(T instance) where T : new() - { - if (instance is null) - { - return new T(); - } - else - { - return instance; - } - } - - [DebuggerHidden()] - private void Dispose__Instance__(ref T instance) - { - instance = default(T); - } - - [DebuggerHidden()] - [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] - public MyWebServices() : base() - { - } - } - - private readonly static ThreadSafeObjectProvider m_MyWebServicesObjectProvider = new ThreadSafeObjectProvider(); - /* TODO ERROR: Skipped EndIfDirectiveTrivia - #End If - */ - /* TODO ERROR: Skipped IfDirectiveTrivia - #If _MYTYPE = "Web" Then - *//* TODO ERROR: Skipped DisabledTextTrivia - - _ - Friend ReadOnly Property Request() As Global.System.Web.HttpRequest - _ - Get - Dim CurrentContext As Global.System.Web.HttpContext = Global.System.Web.HttpContext.Current - If CurrentContext IsNot Nothing Then - Return CurrentContext.Request - End If - Return Nothing - End Get - End Property - - _ - Friend ReadOnly Property Response() As Global.System.Web.HttpResponse - _ - Get - Dim CurrentContext As Global.System.Web.HttpContext = Global.System.Web.HttpContext.Current - If CurrentContext IsNot Nothing Then - Return CurrentContext.Response - End If - Return Nothing - End Get - End Property - - _ - Friend ReadOnly Property Log() As Global.Microsoft.VisualBasic.Logging.AspLog - _ - Get - Return m_LogObjectProvider.GetInstance() - End Get - End Property - - Private ReadOnly m_LogObjectProvider As New ThreadSafeObjectProvider(Of Global.Microsoft.VisualBasic.Logging.AspLog) - - *//* TODO ERROR: Skipped EndIfDirectiveTrivia - #End If '_MYTYPE="Web" - */ - [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] - [System.Runtime.InteropServices.ComVisible(false)] - internal sealed class ThreadSafeObjectProvider where T : new() - { - internal T GetInstance - { - /* TODO ERROR: Skipped IfDirectiveTrivia - #If TARGET = "library" Then - *//* TODO ERROR: Skipped DisabledTextTrivia - _ - Get - Dim Value As T = m_Context.Value - If Value Is Nothing Then - Value = New T - m_Context.Value() = Value - End If - Return Value - End Get - *//* TODO ERROR: Skipped ElseDirectiveTrivia - #Else - */ - [DebuggerHidden()] - get - { - if (m_ThreadStaticValue is null) - m_ThreadStaticValue = new T(); - return m_ThreadStaticValue; - } - /* TODO ERROR: Skipped EndIfDirectiveTrivia - #End If - */ - } - - [DebuggerHidden()] - [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] - public ThreadSafeObjectProvider() : base() - { - } - - /* TODO ERROR: Skipped IfDirectiveTrivia - #If TARGET = "library" Then - *//* TODO ERROR: Skipped DisabledTextTrivia - Private ReadOnly m_Context As New Global.Microsoft.VisualBasic.MyServices.Internal.ContextValue(Of T) - *//* TODO ERROR: Skipped ElseDirectiveTrivia - #Else - */ - [System.Runtime.CompilerServices.CompilerGenerated()] - [ThreadStatic()] - private static T m_ThreadStaticValue; - /* TODO ERROR: Skipped EndIfDirectiveTrivia - #End If - */ - } - } -} -/* TODO ERROR: Skipped EndIfDirectiveTrivia -#End If -*/ \ No newline at end of file diff --git a/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/ConsoleApp1/My Project/Settings.Designer.cs b/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/ConsoleApp1/My Project/Settings.Designer.cs deleted file mode 100644 index 7946e911f..000000000 --- a/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/ConsoleApp1/My Project/Settings.Designer.cs +++ /dev/null @@ -1,88 +0,0 @@ -// ------------------------------------------------------------------------------ -// -// This code was generated by a tool. -// Runtime Version:4.0.30319.42000 -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// -// ------------------------------------------------------------------------------ - -using System.Diagnostics; -using Microsoft.VisualBasic; - - -namespace ConsoleApp1.My -{ - - [System.Runtime.CompilerServices.CompilerGenerated()] - [System.CodeDom.Compiler.GeneratedCode("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "17.1.0.0")] - [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Advanced)] - internal sealed partial class MySettings : System.Configuration.ApplicationSettingsBase - { - - private static MySettings defaultInstance = (MySettings)Synchronized(new MySettings()); - - #region My.Settings Auto-Save Functionality - /* TODO ERROR: Skipped IfDirectiveTrivia - #If _MyType = "WindowsForms" Then - *//* TODO ERROR: Skipped DisabledTextTrivia - Private Shared addedHandler As Boolean - - Private Shared addedHandlerLockObject As New Object - - _ - Private Shared Sub AutoSaveSettings(sender As Global.System.Object, e As Global.System.EventArgs) - If My.Application.SaveMySettingsOnExit Then - My.Settings.Save() - End If - End Sub - *//* TODO ERROR: Skipped EndIfDirectiveTrivia - #End If - */ - #endregion - - public static MySettings Default - { - get - { - - /* TODO ERROR: Skipped IfDirectiveTrivia - #If _MyType = "WindowsForms" Then - *//* TODO ERROR: Skipped DisabledTextTrivia - If Not addedHandler Then - SyncLock addedHandlerLockObject - If Not addedHandler Then - AddHandler My.Application.Shutdown, AddressOf AutoSaveSettings - addedHandler = True - End If - End SyncLock - End If - *//* TODO ERROR: Skipped EndIfDirectiveTrivia - #End If - */ - return defaultInstance; - } - } - } -} - -namespace ConsoleApp1.My -{ - - [HideModuleName()] - [DebuggerNonUserCode()] - [System.Runtime.CompilerServices.CompilerGenerated()] - internal static class MySettingsProperty - { - - [System.ComponentModel.Design.HelpKeyword("My.Settings")] - internal static MySettings Settings - { - get - { - return MySettings.Default; - } - } - } -} \ No newline at end of file diff --git a/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/ConsoleApp1/Resources.Designer.cs b/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/ConsoleApp1/Resources.Designer.cs deleted file mode 100644 index 2dea33015..000000000 --- a/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/ConsoleApp1/Resources.Designer.cs +++ /dev/null @@ -1,70 +0,0 @@ -// ------------------------------------------------------------------------------ -// -// This code was generated by a tool. -// Runtime Version:4.0.30319.42000 -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// -// ------------------------------------------------------------------------------ - - -using System.Diagnostics; -using Microsoft.VisualBasic; - -namespace ConsoleApp1.My.Resources -{ - - // This class was auto-generated by the StronglyTypedResourceBuilder - // class via a tool like ResGen or Visual Studio. - // To add or remove a member, edit your .ResX file then rerun ResGen - // with the /str option, or rebuild your VS project. - /// - /// A strongly-typed resource class, for looking up localized strings, etc. - /// - [System.CodeDom.Compiler.GeneratedCode("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")] - [DebuggerNonUserCode()] - [System.Runtime.CompilerServices.CompilerGenerated()] - [HideModuleName()] - internal static class Resources - { - - private static System.Resources.ResourceManager resourceMan; - - private static System.Globalization.CultureInfo resourceCulture; - - /// - /// Returns the cached ResourceManager instance used by this class. - /// - [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Advanced)] - internal static System.Resources.ResourceManager ResourceManager - { - get - { - if (ReferenceEquals(resourceMan, null)) - { - var temp = new System.Resources.ResourceManager("ConsoleApp1.Resources", typeof(Resources).Assembly); - resourceMan = temp; - } - return resourceMan; - } - } - - /// - /// Overrides the current thread's CurrentUICulture property for all - /// resource lookups using this strongly typed resource class. - /// - [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Advanced)] - internal static System.Globalization.CultureInfo Culture - { - get - { - return resourceCulture; - } - set - { - resourceCulture = value; - } - } - } -} \ No newline at end of file diff --git a/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/ConsoleApp1/Resources.resx b/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/ConsoleApp1/Resources.resx deleted file mode 100644 index 98745a7c7..000000000 --- a/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/ConsoleApp1/Resources.resx +++ /dev/null @@ -1,117 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - \ No newline at end of file diff --git a/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/ConsoleApp1/VisualBasicConsoleApp.csproj b/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/ConsoleApp1/VisualBasicConsoleApp.csproj deleted file mode 100644 index c86d66bdb..000000000 --- a/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/ConsoleApp1/VisualBasicConsoleApp.csproj +++ /dev/null @@ -1,121 +0,0 @@ - - - - - Debug - AnyCPU - {74B9A6AA-3316-0C3A-3957-518673283B21} - Exe - ConsoleApp1.Module1 - ConsoleApp1 - ConsoleApp1 - 512 - Console - v4.8 - true - - $(DefaultItemExcludes);$(ProjectDir)**\*.vb - latest - - - AnyCPU - true - full - bin\Debug\ - bin\Debug\ConsoleApp1.xml - 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022 - TRACE;DEBUG - - - AnyCPU - pdbonly - true - bin\Release\ - bin\Release\ConsoleApp1.xml - 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022 - TRACE - - - On - - - Binary - - - Off - - - On - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - True - Application.myapp - True - - - True - True - Resources.resx - - - True - Settings.settings - True - - - - - ResXFileCodeGenerator - Resources.Designer.cs - ConsoleApp1.My.Resources - Designer - - - - - MyApplicationCodeGenerator - Application.Designer.cs - - - SettingsSingleFileGenerator - ConsoleApp1.My - Settings.Designer.cs - - - - - - {b7602e54-8f45-4dc4-88b5-e11cdc7e8b41} - CSharpConsoleApp - - - - \ No newline at end of file diff --git a/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/ConsoleApp4/ConsoleApp4.csproj b/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/ConsoleApp4/ConsoleApp4.csproj index 740d7e205..33ac7385e 100644 --- a/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/ConsoleApp4/ConsoleApp4.csproj +++ b/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/ConsoleApp4/ConsoleApp4.csproj @@ -2,7 +2,7 @@ Exe ConsoleApp4 - netcoreapp3.1 + net10.0 $(DefaultItemExcludes);$(ProjectDir)**\*.vb latest diff --git a/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/Prefix.VbLibrary/My Project/AssemblyInfo.cs b/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/Prefix.VbLibrary/My Project/AssemblyInfo.cs deleted file mode 100644 index c43c4ca7a..000000000 --- a/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/Prefix.VbLibrary/My Project/AssemblyInfo.cs +++ /dev/null @@ -1,35 +0,0 @@ -using System; -using System.Reflection; -using System.Runtime.InteropServices; - -// 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. - -// Review the values of the assembly attributes - -[assembly: AssemblyTitle("Prefix.VbLibrary")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyCompany("HP Inc.")] -[assembly: AssemblyProduct("Prefix.VbLibrary")] -[assembly: AssemblyCopyright("Copyright © HP Inc. 2021")] -[assembly: AssemblyTrademark("")] - -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("f8a13756-bf39-4447-8ef0-2dae0c851386")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// 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.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/Prefix.VbLibrary/My Project/MyNamespace.Static.1.Designer.cs b/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/Prefix.VbLibrary/My Project/MyNamespace.Static.1.Designer.cs index 1e1f3f001..75d58675f 100644 --- a/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/Prefix.VbLibrary/My Project/MyNamespace.Static.1.Designer.cs +++ b/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/Prefix.VbLibrary/My Project/MyNamespace.Static.1.Designer.cs @@ -3,466 +3,14 @@ // See the LICENSE file in the project root for more information. using System; -using System.Diagnostics; -using Microsoft.VisualBasic; -/* TODO ERROR: Skipped IfDirectiveTrivia -#If TARGET = "module" AndAlso _MYTYPE = "" Then -*//* TODO ERROR: Skipped DisabledTextTrivia -#Const _MYTYPE="Empty" -*//* TODO ERROR: Skipped EndIfDirectiveTrivia -#End If -*/ -/* TODO ERROR: Skipped IfDirectiveTrivia -#If _MYTYPE = "WindowsForms" Then -*//* TODO ERROR: Skipped DisabledTextTrivia - -#Const _MYFORMS = True -#Const _MYWEBSERVICES = True -#Const _MYUSERTYPE = "Windows" -#Const _MYCOMPUTERTYPE = "Windows" -#Const _MYAPPLICATIONTYPE = "WindowsForms" - -*//* TODO ERROR: Skipped ElifDirectiveTrivia -#ElseIf _MYTYPE = "WindowsFormsWithCustomSubMain" Then -*//* TODO ERROR: Skipped DisabledTextTrivia - -#Const _MYFORMS = True -#Const _MYWEBSERVICES = True -#Const _MYUSERTYPE = "Windows" -#Const _MYCOMPUTERTYPE = "Windows" -#Const _MYAPPLICATIONTYPE = "Console" - -*//* TODO ERROR: Skipped ElifDirectiveTrivia -#ElseIf _MYTYPE = "Windows" OrElse _MYTYPE = "" Then -*/ -/* TODO ERROR: Skipped DefineDirectiveTrivia -#Const _MYWEBSERVICES = True -*//* TODO ERROR: Skipped DefineDirectiveTrivia -#Const _MYUSERTYPE = "Windows" -*//* TODO ERROR: Skipped DefineDirectiveTrivia -#Const _MYCOMPUTERTYPE = "Windows" -*//* TODO ERROR: Skipped DefineDirectiveTrivia -#Const _MYAPPLICATIONTYPE = "Windows" -*/ -/* TODO ERROR: Skipped ElifDirectiveTrivia -#ElseIf _MYTYPE = "Console" Then -*//* TODO ERROR: Skipped DisabledTextTrivia - -#Const _MYWEBSERVICES = True -#Const _MYUSERTYPE = "Windows" -#Const _MYCOMPUTERTYPE = "Windows" -#Const _MYAPPLICATIONTYPE = "Console" - -*//* TODO ERROR: Skipped ElifDirectiveTrivia -#ElseIf _MYTYPE = "Web" Then -*//* TODO ERROR: Skipped DisabledTextTrivia - -#Const _MYFORMS = False -#Const _MYWEBSERVICES = False -#Const _MYUSERTYPE = "Web" -#Const _MYCOMPUTERTYPE = "Web" - -*//* TODO ERROR: Skipped ElifDirectiveTrivia -#ElseIf _MYTYPE = "WebControl" Then -*//* TODO ERROR: Skipped DisabledTextTrivia - -#Const _MYFORMS = False -#Const _MYWEBSERVICES = True -#Const _MYUSERTYPE = "Web" -#Const _MYCOMPUTERTYPE = "Web" - -*//* TODO ERROR: Skipped ElifDirectiveTrivia -#ElseIf _MYTYPE = "Custom" Then -*//* TODO ERROR: Skipped DisabledTextTrivia - -*//* TODO ERROR: Skipped ElifDirectiveTrivia -#ElseIf _MYTYPE <> "Empty" Then -*//* TODO ERROR: Skipped DisabledTextTrivia - -#Const _MYTYPE = "Empty" - -*//* TODO ERROR: Skipped EndIfDirectiveTrivia -#End If -*/ -/* TODO ERROR: Skipped IfDirectiveTrivia -#If _MYTYPE <> "Empty" Then -*/ -namespace Prefix.VbLibrary.My +namespace Microsoft.VisualBasic { - - /* TODO ERROR: Skipped IfDirectiveTrivia - #If _MYAPPLICATIONTYPE = "WindowsForms" OrElse _MYAPPLICATIONTYPE = "Windows" OrElse _MYAPPLICATIONTYPE = "Console" Then - */ - [System.CodeDom.Compiler.GeneratedCode("MyTemplate", "11.0.0.0")] - [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] - - /* TODO ERROR: Skipped IfDirectiveTrivia - #If _MYAPPLICATIONTYPE = "WindowsForms" Then - *//* TODO ERROR: Skipped DisabledTextTrivia - Inherits Global.Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase - #If TARGET = "winexe" Then - _ - Friend Shared Sub Main(ByVal Args As String()) - Try - Global.System.Windows.Forms.Application.SetCompatibleTextRenderingDefault(MyApplication.UseCompatibleTextRendering()) - Finally - End Try - My.Application.Run(Args) - End Sub - #End If - - *//* TODO ERROR: Skipped ElifDirectiveTrivia - #ElseIf _MYAPPLICATIONTYPE = "Windows" Then - */ - internal partial class MyApplication : Microsoft.VisualBasic.ApplicationServices.ApplicationBase - { - /* TODO ERROR: Skipped ElifDirectiveTrivia - #ElseIf _MYAPPLICATIONTYPE = "Console" Then - *//* TODO ERROR: Skipped DisabledTextTrivia - Inherits Global.Microsoft.VisualBasic.ApplicationServices.ConsoleApplicationBase - *//* TODO ERROR: Skipped EndIfDirectiveTrivia - #End If '_MYAPPLICATIONTYPE = "WindowsForms" - */ - } - - /* TODO ERROR: Skipped EndIfDirectiveTrivia - #End If '#If _MYAPPLICATIONTYPE = "WindowsForms" Or _MYAPPLICATIONTYPE = "Windows" or _MYAPPLICATIONTYPE = "Console" - */ - /* TODO ERROR: Skipped IfDirectiveTrivia - #If _MYCOMPUTERTYPE <> "" Then - */ - [System.CodeDom.Compiler.GeneratedCode("MyTemplate", "11.0.0.0")] + [Embedded()] + [AttributeUsage(AttributeTargets.Class | AttributeTargets.Module | AttributeTargets.Assembly, Inherited = false)] [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] - - /* TODO ERROR: Skipped IfDirectiveTrivia - #If _MYCOMPUTERTYPE = "Windows" Then - */ - internal partial class MyComputer : Microsoft.VisualBasic.Devices.Computer + [System.Runtime.CompilerServices.CompilerGenerated()] + internal sealed class Embedded : Attribute { - /* TODO ERROR: Skipped ElifDirectiveTrivia - #ElseIf _MYCOMPUTERTYPE = "Web" Then - *//* TODO ERROR: Skipped DisabledTextTrivia - Inherits Global.Microsoft.VisualBasic.Devices.ServerComputer - *//* TODO ERROR: Skipped EndIfDirectiveTrivia - #End If - */ - [DebuggerHidden()] - [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] - public MyComputer() : base() - { - } - } - /* TODO ERROR: Skipped EndIfDirectiveTrivia - #End If - */ - [HideModuleName()] - [System.CodeDom.Compiler.GeneratedCode("MyTemplate", "11.0.0.0")] - internal static class MyProject - { - - /* TODO ERROR: Skipped IfDirectiveTrivia - #If _MYCOMPUTERTYPE <> "" Then - */ - [System.ComponentModel.Design.HelpKeyword("My.Computer")] - internal static MyComputer Computer - { - [DebuggerHidden()] - get - { - return m_ComputerObjectProvider.GetInstance; - } - } - - private readonly static ThreadSafeObjectProvider m_ComputerObjectProvider = new ThreadSafeObjectProvider(); - /* TODO ERROR: Skipped EndIfDirectiveTrivia - #End If - */ - /* TODO ERROR: Skipped IfDirectiveTrivia - #If _MYAPPLICATIONTYPE = "Windows" Or _MYAPPLICATIONTYPE = "WindowsForms" Or _MYAPPLICATIONTYPE = "Console" Then - */ - [System.ComponentModel.Design.HelpKeyword("My.Application")] - internal static MyApplication Application - { - [DebuggerHidden()] - get - { - return m_AppObjectProvider.GetInstance; - } - } - private readonly static ThreadSafeObjectProvider m_AppObjectProvider = new ThreadSafeObjectProvider(); - /* TODO ERROR: Skipped EndIfDirectiveTrivia - #End If - */ - /* TODO ERROR: Skipped IfDirectiveTrivia - #If _MYUSERTYPE = "Windows" Then - */ - [System.ComponentModel.Design.HelpKeyword("My.User")] - internal static Microsoft.VisualBasic.ApplicationServices.User User - { - [DebuggerHidden()] - get - { - return m_UserObjectProvider.GetInstance; - } - } - private readonly static ThreadSafeObjectProvider m_UserObjectProvider = new ThreadSafeObjectProvider(); - /* TODO ERROR: Skipped ElifDirectiveTrivia - #ElseIf _MYUSERTYPE = "Web" Then - *//* TODO ERROR: Skipped DisabledTextTrivia - _ - Friend ReadOnly Property User() As Global.Microsoft.VisualBasic.ApplicationServices.WebUser - _ - Get - Return m_UserObjectProvider.GetInstance() - End Get - End Property - Private ReadOnly m_UserObjectProvider As New ThreadSafeObjectProvider(Of Global.Microsoft.VisualBasic.ApplicationServices.WebUser) - *//* TODO ERROR: Skipped EndIfDirectiveTrivia - #End If - */ - /* TODO ERROR: Skipped IfDirectiveTrivia - #If _MYFORMS = True Then - *//* TODO ERROR: Skipped DisabledTextTrivia - - #Const STARTUP_MY_FORM_FACTORY = "My.MyProject.Forms" - - _ - Friend ReadOnly Property Forms() As MyForms - _ - Get - Return m_MyFormsObjectProvider.GetInstance() - End Get - End Property - - _ - _ - Friend NotInheritable Class MyForms - _ - Private Shared Function Create__Instance__(Of T As {New, Global.System.Windows.Forms.Form})(ByVal Instance As T) As T - If Instance Is Nothing OrElse Instance.IsDisposed Then - If m_FormBeingCreated IsNot Nothing Then - If m_FormBeingCreated.ContainsKey(GetType(T)) = True Then - Throw New Global.System.InvalidOperationException(Global.Microsoft.VisualBasic.CompilerServices.Utils.GetResourceString("WinForms_RecursiveFormCreate")) - End If - Else - m_FormBeingCreated = New Global.System.Collections.Hashtable() - End If - m_FormBeingCreated.Add(GetType(T), Nothing) - Try - Return New T() - Catch ex As Global.System.Reflection.TargetInvocationException When ex.InnerException IsNot Nothing - Dim BetterMessage As String = Global.Microsoft.VisualBasic.CompilerServices.Utils.GetResourceString("WinForms_SeeInnerException", ex.InnerException.Message) - Throw New Global.System.InvalidOperationException(BetterMessage, ex.InnerException) - Finally - m_FormBeingCreated.Remove(GetType(T)) - End Try - Else - Return Instance - End If - End Function - - _ - Private Sub Dispose__Instance__(Of T As Global.System.Windows.Forms.Form)(ByRef instance As T) - instance.Dispose() - instance = Nothing - End Sub - - _ - _ - Public Sub New() - MyBase.New() - End Sub - - Private Shared m_FormBeingCreated As Global.System.Collections.Hashtable - - Public Overrides Function Equals(ByVal o As Object) As Boolean - Return MyBase.Equals(o) - End Function - Public Overrides Function GetHashCode() As Integer - Return MyBase.GetHashCode - End Function - _ - Friend Overloads Function [GetType]() As Global.System.Type - Return GetType(MyForms) - End Function - Public Overrides Function ToString() As String - Return MyBase.ToString - End Function - End Class - - Private m_MyFormsObjectProvider As New ThreadSafeObjectProvider(Of MyForms) - - *//* TODO ERROR: Skipped EndIfDirectiveTrivia - #End If - */ - /* TODO ERROR: Skipped IfDirectiveTrivia - #If _MYWEBSERVICES = True Then - */ - [System.ComponentModel.Design.HelpKeyword("My.WebServices")] - internal static MyWebServices WebServices - { - [DebuggerHidden()] - get - { - return m_MyWebServicesObjectProvider.GetInstance; - } - } - - [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] - [MyGroupCollection("System.Web.Services.Protocols.SoapHttpClientProtocol", "Create__Instance__", "Dispose__Instance__", "")] - internal sealed class MyWebServices - { - - [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] - [DebuggerHidden()] - public override bool Equals(object o) - { - return base.Equals(o); - } - [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] - [DebuggerHidden()] - public override int GetHashCode() - { - return base.GetHashCode(); - } - [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] - [DebuggerHidden()] - internal new Type GetType() - { - return typeof(MyWebServices); - } - [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] - [DebuggerHidden()] - public override string ToString() - { - return base.ToString(); - } - - [DebuggerHidden()] - private static T Create__Instance__(T instance) where T : new() - { - if (instance is null) - { - return new T(); - } - else - { - return instance; - } - } - - [DebuggerHidden()] - private void Dispose__Instance__(ref T instance) - { - instance = default(T); - } - - [DebuggerHidden()] - [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] - public MyWebServices() : base() - { - } - } - - private readonly static ThreadSafeObjectProvider m_MyWebServicesObjectProvider = new ThreadSafeObjectProvider(); - /* TODO ERROR: Skipped EndIfDirectiveTrivia - #End If - */ - /* TODO ERROR: Skipped IfDirectiveTrivia - #If _MYTYPE = "Web" Then - *//* TODO ERROR: Skipped DisabledTextTrivia - - _ - Friend ReadOnly Property Request() As Global.System.Web.HttpRequest - _ - Get - Dim CurrentContext As Global.System.Web.HttpContext = Global.System.Web.HttpContext.Current - If CurrentContext IsNot Nothing Then - Return CurrentContext.Request - End If - Return Nothing - End Get - End Property - - _ - Friend ReadOnly Property Response() As Global.System.Web.HttpResponse - _ - Get - Dim CurrentContext As Global.System.Web.HttpContext = Global.System.Web.HttpContext.Current - If CurrentContext IsNot Nothing Then - Return CurrentContext.Response - End If - Return Nothing - End Get - End Property - - _ - Friend ReadOnly Property Log() As Global.Microsoft.VisualBasic.Logging.AspLog - _ - Get - Return m_LogObjectProvider.GetInstance() - End Get - End Property - - Private ReadOnly m_LogObjectProvider As New ThreadSafeObjectProvider(Of Global.Microsoft.VisualBasic.Logging.AspLog) - - *//* TODO ERROR: Skipped EndIfDirectiveTrivia - #End If '_MYTYPE="Web" - */ - [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] - [System.Runtime.InteropServices.ComVisible(false)] - internal sealed class ThreadSafeObjectProvider where T : new() - { - internal T GetInstance - { - /* TODO ERROR: Skipped IfDirectiveTrivia - #If TARGET = "library" Then - */ - [DebuggerHidden()] - get - { - var Value = m_Context.Value; - if (Value is null) - { - Value = new T(); - m_Context.Value = Value; - } - return Value; - } - /* TODO ERROR: Skipped ElseDirectiveTrivia - #Else - *//* TODO ERROR: Skipped DisabledTextTrivia - _ - Get - If m_ThreadStaticValue Is Nothing Then m_ThreadStaticValue = New T - Return m_ThreadStaticValue - End Get - *//* TODO ERROR: Skipped EndIfDirectiveTrivia - #End If - */ - } - - [DebuggerHidden()] - [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] - public ThreadSafeObjectProvider() : base() - { - } - - /* TODO ERROR: Skipped IfDirectiveTrivia - #If TARGET = "library" Then - */ - private readonly Microsoft.VisualBasic.MyServices.Internal.ContextValue m_Context = new Microsoft.VisualBasic.MyServices.Internal.ContextValue(); - /* TODO ERROR: Skipped ElseDirectiveTrivia - #Else - *//* TODO ERROR: Skipped DisabledTextTrivia - Private Shared m_ThreadStaticValue As T - *//* TODO ERROR: Skipped EndIfDirectiveTrivia - #End If - */ - } } -} -/* TODO ERROR: Skipped EndIfDirectiveTrivia -#End If -*/ \ No newline at end of file +} \ No newline at end of file diff --git a/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/Prefix.VbLibrary/My Project/MyNamespace.Static.2.Designer.cs b/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/Prefix.VbLibrary/My Project/MyNamespace.Static.2.Designer.cs index 1eafdfc6b..7ff83277c 100644 --- a/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/Prefix.VbLibrary/My Project/MyNamespace.Static.2.Designer.cs +++ b/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/Prefix.VbLibrary/My Project/MyNamespace.Static.2.Designer.cs @@ -1,239 +1,1855 @@ -using System.Collections; -using System.Collections.Generic; -using System.Data; -using System.Diagnostics; -using System.Linq; -using System.Xml.Linq; -using Microsoft.VisualBasic; // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. -// See Compiler::LoadXmlSolutionExtension -namespace Prefix.VbLibrary.My +using System; +using System.Diagnostics; +using Microsoft.VisualBasic.CompilerServices; + +namespace Microsoft.VisualBasic { - [Embedded()] - [DebuggerNonUserCode()] - [System.Runtime.CompilerServices.CompilerGenerated()] - [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] - internal sealed class InternalXmlHelper + namespace CompilerServices { + [Embedded()] + [DebuggerNonUserCode()] + [System.Runtime.CompilerServices.CompilerGenerated()] [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] - private InternalXmlHelper() - { - } - public static string get_Value(IEnumerable source) + internal sealed class EmbeddedOperators { - foreach (XElement item in source) - return item.Value; - return null; + private EmbeddedOperators() + { + } + public static int CompareString(string Left, string Right, bool TextCompare) + { + if (ReferenceEquals(Left, Right)) + { + return 0; + } + if (Left is null) + { + if (Right.Length == 0) + { + return 0; + } + return -1; + } + if (Right is null) + { + if (Left.Length == 0) + { + return 0; + } + return 1; + } + int Result; + if (TextCompare) + { + var OptionCompareTextFlags = System.Globalization.CompareOptions.IgnoreCase | System.Globalization.CompareOptions.IgnoreWidth | System.Globalization.CompareOptions.IgnoreKanaType; + Result = Conversions.GetCultureInfo().CompareInfo.Compare(Left, Right, OptionCompareTextFlags); + } + else + { + Result = string.CompareOrdinal(Left, Right); + } + if (Result == 0) + { + return 0; + } + else if (Result > 0) + { + return 1; + } + else + { + return -1; + } + } } - public static void set_Value(IEnumerable source, string value) + [Embedded()] + [DebuggerNonUserCode()] + [System.Runtime.CompilerServices.CompilerGenerated()] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + internal sealed class Conversions { - foreach (XElement item in source) + private Conversions() + { + } + private static object GetEnumValue(object Value) + { + var underlyingType = Enum.GetUnderlyingType(Value.GetType()); + if (underlyingType.Equals(typeof(sbyte))) + { + return (sbyte)Value; + } + else if (underlyingType.Equals(typeof(byte))) + { + return (byte)Value; + } + else if (underlyingType.Equals(typeof(short))) + { + return (short)Value; + } + else if (underlyingType.Equals(typeof(ushort))) + { + return (ushort)Value; + } + else if (underlyingType.Equals(typeof(int))) + { + return (int)Value; + } + else if (underlyingType.Equals(typeof(uint))) + { + return (uint)Value; + } + else if (underlyingType.Equals(typeof(long))) + { + return (long)Value; + } + else if (underlyingType.Equals(typeof(ulong))) + { + return (ulong)Value; + } + else + { + throw new InvalidCastException(); + } + } + public static bool ToBoolean(string Value) + { + if (Value is null) + { + Value = ""; + } + try + { + var loc = GetCultureInfo(); + if (loc.CompareInfo.Compare(Value, bool.FalseString, System.Globalization.CompareOptions.IgnoreCase) == 0) + { + return false; + } + else if (loc.CompareInfo.Compare(Value, bool.TrueString, System.Globalization.CompareOptions.IgnoreCase) == 0) + { + return true; + } + var i64Value = default(long); + if (IsHexOrOctValue(Value, ref i64Value)) + { + return ToBoolean(i64Value); + } + return ToBoolean(ParseDouble(Value)); + } + catch (FormatException e) + { + throw new InvalidCastException(e.Message, e); + } + } + public static bool ToBoolean(object Value) + { + if (Value is null) + { + return false; + } + if (Value is Enum) + { + Value = GetEnumValue(Value); + } + if (Value is bool) + { + return (bool)Value; + } + else if (Value is sbyte) + { + return ToBoolean((sbyte)Value); + } + else if (Value is byte) + { + return ToBoolean((byte)Value); + } + else if (Value is short) + { + return ToBoolean((short)Value); + } + else if (Value is ushort) + { + return ToBoolean((ushort)Value); + } + else if (Value is int) + { + return ToBoolean((int)Value); + } + else if (Value is uint) + { + return ToBoolean((uint)Value); + } + else if (Value is long) + { + return ToBoolean((long)Value); + } + else if (Value is ulong) + { + return ToBoolean((ulong)Value); + } + else if (Value is decimal) + { + return ToBoolean((decimal)Value); + } + else if (Value is float) + { + return ToBoolean((float)Value); + } + else if (Value is double) + { + return ToBoolean((double)Value); + } + else if (Value is string) + { + return ToBoolean((string)Value); + } + throw new InvalidCastException(); + } + public static byte ToByte(string Value) + { + if (Value is null) + { + return 0; + } + try + { + var i64Value = default(long); + if (IsHexOrOctValue(Value, ref i64Value)) + { + return (byte)i64Value; + } + return (byte)Math.Round(ParseDouble(Value)); + } + catch (FormatException e) + { + throw new InvalidCastException(e.Message, e); + } + } + public static byte ToByte(object Value) + { + if (Value is null) + { + return 0; + } + if (Value is Enum) + { + Value = GetEnumValue(Value); + } + if (Value is bool) + { + return ToByte((bool)Value); + } + else if (Value is sbyte) + { + return (byte)(sbyte)Value; + } + else if (Value is byte) + { + return (byte)Value; + } + else if (Value is short) + { + return (byte)(short)Value; + } + else if (Value is ushort) + { + return (byte)(ushort)Value; + } + else if (Value is int) + { + return (byte)(int)Value; + } + else if (Value is uint) + { + return (byte)(uint)Value; + } + else if (Value is long) + { + return (byte)(long)Value; + } + else if (Value is ulong) + { + return (byte)(ulong)Value; + } + else if (Value is decimal) + { + return (byte)Math.Round((decimal)Value); + } + else if (Value is float) + { + return (byte)Math.Round((float)Value); + } + else if (Value is double) + { + return (byte)Math.Round((double)Value); + } + else if (Value is string) + { + return ToByte((string)Value); + } + throw new InvalidCastException(); + } + [CLSCompliant(false)] + public static sbyte ToSByte(string Value) + { + if (Value is null) + { + return 0; + } + try + { + var i64Value = default(long); + if (IsHexOrOctValue(Value, ref i64Value)) + { + return (sbyte)i64Value; + } + return (sbyte)Math.Round(ParseDouble(Value)); + } + catch (FormatException e) + { + throw new InvalidCastException(e.Message, e); + } + } + [CLSCompliant(false)] + public static sbyte ToSByte(object Value) + { + if (Value is null) + { + return 0; + } + if (Value is Enum) + { + Value = GetEnumValue(Value); + } + if (Value is bool) + { + return ToSByte((bool)Value); + } + else if (Value is sbyte) + { + return (sbyte)Value; + } + else if (Value is byte) + { + return (sbyte)(byte)Value; + } + else if (Value is short) + { + return (sbyte)(short)Value; + } + else if (Value is ushort) + { + return (sbyte)(ushort)Value; + } + else if (Value is int) + { + return (sbyte)(int)Value; + } + else if (Value is uint) + { + return (sbyte)(uint)Value; + } + else if (Value is long) + { + return (sbyte)(long)Value; + } + else if (Value is ulong) + { + return (sbyte)(ulong)Value; + } + else if (Value is decimal) + { + return (sbyte)Math.Round((decimal)Value); + } + else if (Value is float) + { + return (sbyte)Math.Round((float)Value); + } + else if (Value is double) + { + return (sbyte)Math.Round((double)Value); + } + else if (Value is string) + { + return ToSByte((string)Value); + } + throw new InvalidCastException(); + } + public static short ToShort(string Value) + { + if (Value is null) + { + return 0; + } + try + { + var i64Value = default(long); + if (IsHexOrOctValue(Value, ref i64Value)) + { + return (short)i64Value; + } + return (short)Math.Round(ParseDouble(Value)); + } + catch (FormatException e) + { + throw new InvalidCastException(e.Message, e); + } + } + public static short ToShort(object Value) + { + if (Value is null) + { + return 0; + } + if (Value is Enum) + { + Value = GetEnumValue(Value); + } + if (Value is bool) + { + return ToShort((bool)Value); + } + else if (Value is sbyte) + { + return (sbyte)Value; + } + else if (Value is byte) + { + return (byte)Value; + } + else if (Value is short) + { + return (short)Value; + } + else if (Value is ushort) + { + return (short)(ushort)Value; + } + else if (Value is int) + { + return (short)(int)Value; + } + else if (Value is uint) + { + return (short)(uint)Value; + } + else if (Value is long) + { + return (short)(long)Value; + } + else if (Value is ulong) + { + return (short)(ulong)Value; + } + else if (Value is decimal) + { + return (short)Math.Round((decimal)Value); + } + else if (Value is float) + { + return (short)Math.Round((float)Value); + } + else if (Value is double) + { + return (short)Math.Round((double)Value); + } + else if (Value is string) + { + return ToShort((string)Value); + } + throw new InvalidCastException(); + } + [CLSCompliant(false)] + public static ushort ToUShort(string Value) + { + if (Value is null) + { + return 0; + } + try + { + var i64Value = default(long); + if (IsHexOrOctValue(Value, ref i64Value)) + { + return (ushort)i64Value; + } + return (ushort)Math.Round(ParseDouble(Value)); + } + catch (FormatException e) + { + throw new InvalidCastException(e.Message, e); + } + } + [CLSCompliant(false)] + public static ushort ToUShort(object Value) + { + if (Value is null) + { + return 0; + } + if (Value is Enum) + { + Value = GetEnumValue(Value); + } + if (Value is bool) + { + return ToUShort((bool)Value); + } + else if (Value is sbyte) + { + return (ushort)(sbyte)Value; + } + else if (Value is byte) + { + return (byte)Value; + } + else if (Value is short) + { + return (ushort)(short)Value; + } + else if (Value is ushort) + { + return (ushort)Value; + } + else if (Value is int) + { + return (ushort)(int)Value; + } + else if (Value is uint) + { + return (ushort)(uint)Value; + } + else if (Value is long) + { + return (ushort)(long)Value; + } + else if (Value is ulong) + { + return (ushort)(ulong)Value; + } + else if (Value is decimal) + { + return (ushort)Math.Round((decimal)Value); + } + else if (Value is float) + { + return (ushort)Math.Round((float)Value); + } + else if (Value is double) + { + return (ushort)Math.Round((double)Value); + } + else if (Value is string) + { + return ToUShort((string)Value); + } + throw new InvalidCastException(); + } + public static int ToInteger(string Value) + { + if (Value is null) + { + return 0; + } + try + { + var i64Value = default(long); + if (IsHexOrOctValue(Value, ref i64Value)) + { + return (int)i64Value; + } + return (int)Math.Round(ParseDouble(Value)); + } + catch (FormatException e) + { + throw new InvalidCastException(e.Message, e); + } + } + public static int ToInteger(object Value) + { + if (Value is null) + { + return 0; + } + if (Value is Enum) + { + Value = GetEnumValue(Value); + } + if (Value is bool) + { + return ToInteger((bool)Value); + } + else if (Value is sbyte) + { + return (sbyte)Value; + } + else if (Value is byte) + { + return (byte)Value; + } + else if (Value is short) + { + return (short)Value; + } + else if (Value is ushort) + { + return (ushort)Value; + } + else if (Value is int) + { + return (int)Value; + } + else if (Value is uint) + { + return (int)(uint)Value; + } + else if (Value is long) + { + return (int)(long)Value; + } + else if (Value is ulong) + { + return (int)(ulong)Value; + } + else if (Value is decimal) + { + return (int)Math.Round((decimal)Value); + } + else if (Value is float) + { + return (int)Math.Round((float)Value); + } + else if (Value is double) + { + return (int)Math.Round((double)Value); + } + else if (Value is string) + { + return ToInteger((string)Value); + } + throw new InvalidCastException(); + } + [CLSCompliant(false)] + public static uint ToUInteger(string Value) + { + if (Value is null) + { + return 0U; + } + try + { + var i64Value = default(long); + if (IsHexOrOctValue(Value, ref i64Value)) + { + return (uint)i64Value; + } + return (uint)Math.Round(ParseDouble(Value)); + } + catch (FormatException e) + { + throw new InvalidCastException(e.Message, e); + } + } + [CLSCompliant(false)] + public static uint ToUInteger(object Value) + { + if (Value is null) + { + return 0U; + } + if (Value is Enum) + { + Value = GetEnumValue(Value); + } + if (Value is bool) + { + return ToUInteger((bool)Value); + } + else if (Value is sbyte) + { + return (uint)(sbyte)Value; + } + else if (Value is byte) + { + return (byte)Value; + } + else if (Value is short) + { + return (uint)(short)Value; + } + else if (Value is ushort) + { + return (ushort)Value; + } + else if (Value is int) + { + return (uint)(int)Value; + } + else if (Value is uint) + { + return (uint)Value; + } + else if (Value is long) + { + return (uint)(long)Value; + } + else if (Value is ulong) + { + return (uint)(ulong)Value; + } + else if (Value is decimal) + { + return (uint)Math.Round((decimal)Value); + } + else if (Value is float) + { + return (uint)Math.Round((float)Value); + } + else if (Value is double) + { + return (uint)Math.Round((double)Value); + } + else if (Value is string) + { + return ToUInteger((string)Value); + } + throw new InvalidCastException(); + } + public static long ToLong(string Value) + { + if (Value is null) + { + return 0L; + } + try + { + var i64Value = default(long); + if (IsHexOrOctValue(Value, ref i64Value)) + { + return i64Value; + } + return (long)Math.Round(ParseDecimal(Value, null)); + } + catch (FormatException e) + { + throw new InvalidCastException(e.Message, e); + } + } + public static long ToLong(object Value) + { + if (Value is null) + { + return 0L; + } + if (Value is Enum) + { + Value = GetEnumValue(Value); + } + if (Value is bool) + { + return ToLong((bool)Value); + } + else if (Value is sbyte) + { + return (sbyte)Value; + } + else if (Value is byte) + { + return (byte)Value; + } + else if (Value is short) + { + return (short)Value; + } + else if (Value is ushort) + { + return (ushort)Value; + } + else if (Value is int) + { + return (int)Value; + } + else if (Value is uint) + { + return (uint)Value; + } + else if (Value is long) + { + return (long)Value; + } + else if (Value is ulong) + { + return (long)(ulong)Value; + } + else if (Value is decimal) + { + return (long)Math.Round((decimal)Value); + } + else if (Value is float) + { + return (long)Math.Round((float)Value); + } + else if (Value is double) + { + return (long)Math.Round((double)Value); + } + else if (Value is string) + { + return ToLong((string)Value); + } + throw new InvalidCastException(); + } + [CLSCompliant(false)] + public static ulong ToULong(string Value) + { + if (Value is null) + { + return 0UL; + } + try + { + var ui64Value = default(ulong); + if (IsHexOrOctValue(Value, ref ui64Value)) + { + return ui64Value; + } + return (ulong)Math.Round(ParseDecimal(Value, null)); + } + catch (FormatException e) + { + throw new InvalidCastException(e.Message, e); + } + } + [CLSCompliant(false)] + public static ulong ToULong(object Value) + { + if (Value is null) + { + return 0UL; + } + if (Value is Enum) + { + Value = GetEnumValue(Value); + } + if (Value is bool) + { + return ToULong((bool)Value); + } + else if (Value is sbyte) + { + return (ulong)(sbyte)Value; + } + else if (Value is byte) + { + return (byte)Value; + } + else if (Value is short) + { + return (ulong)(short)Value; + } + else if (Value is ushort) + { + return (ushort)Value; + } + else if (Value is int) + { + return (ulong)(int)Value; + } + else if (Value is uint) + { + return (uint)Value; + } + else if (Value is long) + { + return (ulong)(long)Value; + } + else if (Value is ulong) + { + return (ulong)Value; + } + else if (Value is decimal) + { + return (ulong)Math.Round((decimal)Value); + } + else if (Value is float) + { + return (ulong)Math.Round((float)Value); + } + else if (Value is double) + { + return (ulong)Math.Round((double)Value); + } + else if (Value is string) + { + return ToULong((string)Value); + } + throw new InvalidCastException(); + } + public static decimal ToDecimal(bool Value) + { + if (Value) + { + return -1m; + } + else + { + return 0m; + } + } + public static decimal ToDecimal(string Value) + { + if (Value is null) + { + return 0m; + } + try + { + var i64Value = default(long); + if (IsHexOrOctValue(Value, ref i64Value)) + { + return i64Value; + } + return ParseDecimal(Value, null); + } + catch (OverflowException e1) + { + throw e1; + } + catch (FormatException e2) + { + throw new InvalidCastException(e2.Message, e2); + } + } + public static decimal ToDecimal(object Value) + { + if (Value is null) + { + return 0m; + } + if (Value is Enum) + { + Value = GetEnumValue(Value); + } + if (Value is bool) + { + return ToDecimal((bool)Value); + } + else if (Value is sbyte) + { + return (sbyte)Value; + } + else if (Value is byte) + { + return (byte)Value; + } + else if (Value is short) + { + return (short)Value; + } + else if (Value is ushort) + { + return (ushort)Value; + } + else if (Value is int) + { + return (int)Value; + } + else if (Value is uint) + { + return (uint)Value; + } + else if (Value is long) + { + return (long)Value; + } + else if (Value is ulong) + { + return (ulong)Value; + } + else if (Value is decimal) + { + return (decimal)Value; + } + else if (Value is float) + { + return (decimal)(float)Value; + } + else if (Value is double) + { + return (decimal)(double)Value; + } + else if (Value is string) + { + return ToDecimal((string)Value); + } + throw new InvalidCastException(); + } + private static decimal ParseDecimal(string Value, System.Globalization.NumberFormatInfo NumberFormat) + { + System.Globalization.NumberFormatInfo NormalizedNumberFormat; + var culture = GetCultureInfo(); + if (NumberFormat is null) + { + NumberFormat = culture.NumberFormat; + } + NormalizedNumberFormat = GetNormalizedNumberFormat(NumberFormat); + const System.Globalization.NumberStyles flags = System.Globalization.NumberStyles.AllowDecimalPoint | System.Globalization.NumberStyles.AllowExponent | System.Globalization.NumberStyles.AllowLeadingSign | System.Globalization.NumberStyles.AllowLeadingWhite | System.Globalization.NumberStyles.AllowThousands | System.Globalization.NumberStyles.AllowTrailingSign | System.Globalization.NumberStyles.AllowParentheses | System.Globalization.NumberStyles.AllowTrailingWhite | System.Globalization.NumberStyles.AllowCurrencySymbol; + Value = ToHalfwidthNumbers(Value, culture); + try + { + return decimal.Parse(Value, flags, NormalizedNumberFormat); + } + catch (FormatException FormatEx) when (!ReferenceEquals(NumberFormat, NormalizedNumberFormat)) + { + return decimal.Parse(Value, flags, NumberFormat); + } + catch (Exception Ex) + { + throw Ex; + } + } + private static System.Globalization.NumberFormatInfo GetNormalizedNumberFormat(System.Globalization.NumberFormatInfo InNumberFormat) + { + System.Globalization.NumberFormatInfo OutNumberFormat; + if (InNumberFormat.CurrencyDecimalSeparator is not null && InNumberFormat.NumberDecimalSeparator is not null && InNumberFormat.CurrencyGroupSeparator is not null && InNumberFormat.NumberGroupSeparator is not null && InNumberFormat.CurrencyDecimalSeparator.Length == 1 && InNumberFormat.NumberDecimalSeparator.Length == 1 && InNumberFormat.CurrencyGroupSeparator.Length == 1 && InNumberFormat.NumberGroupSeparator.Length == 1 && InNumberFormat.CurrencyDecimalSeparator[0] == InNumberFormat.NumberDecimalSeparator[0] && InNumberFormat.CurrencyGroupSeparator[0] == InNumberFormat.NumberGroupSeparator[0] && InNumberFormat.CurrencyDecimalDigits == InNumberFormat.NumberDecimalDigits) + { + return InNumberFormat; + } + if (InNumberFormat.CurrencyDecimalSeparator is not null && InNumberFormat.NumberDecimalSeparator is not null && InNumberFormat.CurrencyDecimalSeparator.Length == InNumberFormat.NumberDecimalSeparator.Length && InNumberFormat.CurrencyGroupSeparator is not null && InNumberFormat.NumberGroupSeparator is not null && InNumberFormat.CurrencyGroupSeparator.Length == InNumberFormat.NumberGroupSeparator.Length) + { + int i; + var loopTo = InNumberFormat.CurrencyDecimalSeparator.Length - 1; + for (i = 0; i <= loopTo; i++) + { + if (InNumberFormat.CurrencyDecimalSeparator[i] != InNumberFormat.NumberDecimalSeparator[i]) + goto MisMatch; + } + var loopTo1 = InNumberFormat.CurrencyGroupSeparator.Length - 1; + for (i = 0; i <= loopTo1; i++) + { + if (InNumberFormat.CurrencyGroupSeparator[i] != InNumberFormat.NumberGroupSeparator[i]) + goto MisMatch; + } + return InNumberFormat; + } + + MisMatch: + ; + + OutNumberFormat = (System.Globalization.NumberFormatInfo)InNumberFormat.Clone(); + OutNumberFormat.CurrencyDecimalSeparator = OutNumberFormat.NumberDecimalSeparator; + OutNumberFormat.CurrencyGroupSeparator = OutNumberFormat.NumberGroupSeparator; + OutNumberFormat.CurrencyDecimalDigits = OutNumberFormat.NumberDecimalDigits; + return OutNumberFormat; + } + public static float ToSingle(string Value) + { + if (Value is null) + { + return 0f; + } + try + { + var i64Value = default(long); + if (IsHexOrOctValue(Value, ref i64Value)) + { + return i64Value; + } + double Result = ParseDouble(Value); + if ((Result < float.MinValue || Result > float.MaxValue) && !double.IsInfinity(Result)) + { + throw new OverflowException(); + } + return (float)Result; + } + catch (FormatException e) + { + throw new InvalidCastException(e.Message, e); + } + } + public static float ToSingle(object Value) + { + if (Value is null) + { + return 0f; + } + if (Value is Enum) + { + Value = GetEnumValue(Value); + } + if (Value is bool) + { + return ToSingle((bool)Value); + } + else if (Value is sbyte) + { + return (sbyte)Value; + } + else if (Value is byte) + { + return (byte)Value; + } + else if (Value is short) + { + return (short)Value; + } + else if (Value is ushort) + { + return (ushort)Value; + } + else if (Value is int) + { + return (int)Value; + } + else if (Value is uint) + { + return (uint)Value; + } + else if (Value is long) + { + return (long)Value; + } + else if (Value is ulong) + { + return (ulong)Value; + } + else if (Value is decimal) + { + return (float)(decimal)Value; + } + else if (Value is float) + { + return (float)Value; + } + else if (Value is double) + { + return (float)(double)Value; + } + else if (Value is string) + { + return ToSingle((string)Value); + } + throw new InvalidCastException(); + } + public static double ToDouble(string Value) + { + if (Value is null) + { + return 0d; + } + try + { + var i64Value = default(long); + if (IsHexOrOctValue(Value, ref i64Value)) + { + return i64Value; + } + return ParseDouble(Value); + } + catch (FormatException e) + { + throw new InvalidCastException(e.Message, e); + } + } + public static double ToDouble(object Value) + { + if (Value is null) + { + return 0d; + } + if (Value is Enum) + { + Value = GetEnumValue(Value); + } + if (Value is bool) + { + return ToDouble((bool)Value); + } + else if (Value is sbyte) + { + return (sbyte)Value; + } + else if (Value is byte) + { + return (byte)Value; + } + else if (Value is short) + { + return (short)Value; + } + else if (Value is ushort) + { + return (ushort)Value; + } + else if (Value is int) + { + return (int)Value; + } + else if (Value is uint) + { + return (uint)Value; + } + else if (Value is long) + { + return (long)Value; + } + else if (Value is ulong) + { + return (ulong)Value; + } + else if (Value is decimal) + { + return (double)(decimal)Value; + } + else if (Value is float) + { + return (double)(float)Value; + } + else if (Value is double) + { + return (double)Value; + } + else if (Value is string) + { + return ToDouble((string)Value); + } + throw new InvalidCastException(); + } + private static double ParseDouble(string Value) + { + System.Globalization.NumberFormatInfo NormalizedNumberFormat; + var culture = GetCultureInfo(); + var NumberFormat = culture.NumberFormat; + NormalizedNumberFormat = GetNormalizedNumberFormat(NumberFormat); + const System.Globalization.NumberStyles flags = System.Globalization.NumberStyles.AllowDecimalPoint | System.Globalization.NumberStyles.AllowExponent | System.Globalization.NumberStyles.AllowLeadingSign | System.Globalization.NumberStyles.AllowLeadingWhite | System.Globalization.NumberStyles.AllowThousands | System.Globalization.NumberStyles.AllowTrailingSign | System.Globalization.NumberStyles.AllowParentheses | System.Globalization.NumberStyles.AllowTrailingWhite | System.Globalization.NumberStyles.AllowCurrencySymbol; + Value = ToHalfwidthNumbers(Value, culture); + try + { + return double.Parse(Value, flags, NormalizedNumberFormat); + } + catch (FormatException FormatEx) when (!ReferenceEquals(NumberFormat, NormalizedNumberFormat)) + { + return double.Parse(Value, flags, NumberFormat); + } + catch (Exception Ex) + { + throw Ex; + } + } + public static DateTime ToDate(string Value) + { + DateTime ParsedDate; + const System.Globalization.DateTimeStyles ParseStyle = System.Globalization.DateTimeStyles.AllowWhiteSpaces | System.Globalization.DateTimeStyles.NoCurrentDateDefault; + var Culture = GetCultureInfo(); + bool result = DateTime.TryParse(ToHalfwidthNumbers(Value, Culture), Culture, ParseStyle, out ParsedDate); + if (result) + { + return ParsedDate; + } + else + { + throw new InvalidCastException(); + } + } + public static DateTime ToDate(object Value) + { + if (Value is null) + { + return default(DateTime); + } + if (Value is DateTime) + { + return ToDate((DateTime)Value); + } + else if (Value is string) + { + return ToDate((string)Value); + } + throw new InvalidCastException(); + } + public static char ToChar(string Value) + { + if (Value is null || Value.Length == 0) + { + return Convert.ToChar(0 & 0xFFFF); + } + return Value[0]; + } + public static char ToChar(object Value) + { + if (Value is null) + { + return Convert.ToChar(0 & 0xFFFF); + } + if (Value is char) + { + return (char)Value; + } + else if (Value is string) + { + return ToChar((string)Value); + } + throw new InvalidCastException(); + } + public static char[] ToCharArrayRankOne(string Value) + { + if (Value is null) + { + Value = ""; + } + return Value.ToCharArray(); + } + public static char[] ToCharArrayRankOne(object Value) + { + if (Value is null) + { + return "".ToCharArray(); + } + char[] ArrayValue = Value as char[]; + if (ArrayValue is not null && ArrayValue.Rank == 1) + { + return ArrayValue; + } + else if (Value is string) + { + return ((string)Value).ToCharArray(); + } + throw new InvalidCastException(); + } + public static new string ToString(short Value) { - item.Value = value; - break; + return Value.ToString(); } - } - public static string get_AttributeValue(IEnumerable source, XName name) - { - foreach (XElement item in source) - return (string)item.Attribute(name); - return null; - } - public static void set_AttributeValue(IEnumerable source, XName name, string value) - { - foreach (XElement item in source) + public static new string ToString(int Value) { - item.SetAttributeValue(name, value); - break; + return Value.ToString(); } - } - public static string get_AttributeValue(XElement source, XName name) - { - return (string)source.Attribute(name); - } - public static void set_AttributeValue(XElement source, XName name, string value) - { - source.SetAttributeValue(name, value); - } - [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] - public static XAttribute CreateAttribute(XName name, object value) - { - if (value is null) + [CLSCompliant(false)] + public static new string ToString(uint Value) { - return null; + return Value.ToString(); } - return new XAttribute(name, value); - } - [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] - public static XAttribute CreateNamespaceAttribute(XName name, XNamespace ns) - { - var a = new XAttribute(name, ns.NamespaceName); - a.AddAnnotation(ns); - return a; - } - [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] - public static object RemoveNamespaceAttributes(string[] inScopePrefixes, XNamespace[] inScopeNs, List attributes, object obj) - { - if (obj is not null) + public static new string ToString(long Value) + { + return Value.ToString(); + } + [CLSCompliant(false)] + public static new string ToString(ulong Value) + { + return Value.ToString(); + } + public static new string ToString(float Value) + { + return Value.ToString(); + } + public static new string ToString(double Value) + { + return Value.ToString("G"); + } + public static new string ToString(DateTime Value) + { + long TimeTicks = Value.TimeOfDay.Ticks; + if (TimeTicks == Value.Ticks || Value.Year == 1899 && Value.Month == 12 && Value.Day == 30) + { + return Value.ToString("T"); + } + else if (TimeTicks == 0L) + { + return Value.ToString("d"); + } + else + { + return Value.ToString("G"); + } + } + public static new string ToString(decimal Value) + { + return Value.ToString("G"); + } + public static new string ToString(object Value) + { + if (Value is null) + { + return null; + } + else + { + string StringValue = Value as string; + if (StringValue is not null) + { + return StringValue; + } + } + if (Value is Enum) + { + Value = GetEnumValue(Value); + } + if (Value is bool) + { + return ToString((bool)Value); + } + else if (Value is sbyte) + { + return ((sbyte)Value).ToString(); + } + else if (Value is byte) + { + return ((byte)Value).ToString(); + } + else if (Value is short) + { + return ((short)Value).ToString(); + } + else if (Value is ushort) + { + return ((ushort)Value).ToString(); + } + else if (Value is int) + { + return ((int)Value).ToString(); + } + else if (Value is uint) + { + return ((uint)Value).ToString(); + } + else if (Value is long) + { + return ((long)Value).ToString(); + } + else if (Value is ulong) + { + return ((ulong)Value).ToString(); + } + else if (Value is decimal) + { + return ((decimal)Value).ToString(); + } + else if (Value is float) + { + return ((float)Value).ToString(); + } + else if (Value is double) + { + return ((double)Value).ToString(); + } + else if (Value is char) + { + return ToString((char)Value); + } + else if (Value is DateTime) + { + return ToString((DateTime)Value); + } + else + { + char[] CharArray = Value as char[]; + if (CharArray is not null) + { + return new string(CharArray); + } + } + throw new InvalidCastException(); + } + public static new string ToString(bool Value) { - XElement elem = obj as XElement; - if (elem is not null) + if (Value) + { + return bool.TrueString; + } + else + { + return bool.FalseString; + } + } + public static new string ToString(byte Value) + { + return Value.ToString(); + } + public static new string ToString(char Value) + { + return Value.ToString(); + } + internal static System.Globalization.CultureInfo GetCultureInfo() + { + return System.Globalization.CultureInfo.CurrentCulture; + } + internal static string ToHalfwidthNumbers(string s, System.Globalization.CultureInfo culture) + { + return s; + } + internal static bool IsHexOrOctValue(string Value, ref long i64Value) + { + char ch; + int Length; + var FirstNonspace = default(int); + string TmpValue; + Length = Value.Length; + while (FirstNonspace < Length) + { + ch = Value[FirstNonspace]; + if (ch == '&' && FirstNonspace + 2 < Length) + { + goto GetSpecialValue; + } + if (ch != Strings.ChrW(32) && ch != Strings.ChrW(0x3000)) + { + return false; + } + FirstNonspace += 1; + } + return false; + GetSpecialValue: + ; + + ch = char.ToLowerInvariant(Value[FirstNonspace + 1]); + TmpValue = ToHalfwidthNumbers(Value.Substring(FirstNonspace + 2), GetCultureInfo()); + if (ch == 'h') + { + i64Value = Convert.ToInt64(TmpValue, 16); + } + else if (ch == 'o') { - return RemoveNamespaceAttributes(inScopePrefixes, inScopeNs, attributes, elem); + i64Value = Convert.ToInt64(TmpValue, 8); } else { - IEnumerable elems = obj as IEnumerable; - if (elems is not null) + throw new FormatException(); + } + return true; + } + internal static bool IsHexOrOctValue(string Value, ref ulong ui64Value) + { + char ch; + int Length; + var FirstNonspace = default(int); + string TmpValue; + Length = Value.Length; + while (FirstNonspace < Length) + { + ch = Value[FirstNonspace]; + if (ch == '&' && FirstNonspace + 2 < Length) { - return RemoveNamespaceAttributes(inScopePrefixes, inScopeNs, attributes, elems); + goto GetSpecialValue; } + if (ch != Strings.ChrW(32) && ch != Strings.ChrW(0x3000)) + { + return false; + } + FirstNonspace += 1; + } + return false; + GetSpecialValue: + ; + + ch = char.ToLowerInvariant(Value[FirstNonspace + 1]); + TmpValue = ToHalfwidthNumbers(Value.Substring(FirstNonspace + 2), GetCultureInfo()); + if (ch == 'h') + { + ui64Value = Convert.ToUInt64(TmpValue, 16); + } + else if (ch == 'o') + { + ui64Value = Convert.ToUInt64(TmpValue, 8); + } + else + { + throw new FormatException(); } + return true; } - return obj; - } - [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] - public static IEnumerable RemoveNamespaceAttributes(string[] inScopePrefixes, XNamespace[] inScopeNs, List attributes, IEnumerable obj) - { - if (obj is not null) + public static T ToGenericParameter(object Value) { - IEnumerable elems = obj as IEnumerable; - if (elems is not null) + if (Value is null) + { + return default(T); + } + var reflectedType = typeof(T); + if (Equals(reflectedType, typeof(bool))) + { + return (T)(object)ToBoolean(Value); + } + else if (Equals(reflectedType, typeof(sbyte))) + { + return (T)(object)ToSByte(Value); + } + else if (Equals(reflectedType, typeof(byte))) + { + return (T)(object)ToByte(Value); + } + else if (Equals(reflectedType, typeof(short))) + { + return (T)(object)ToShort(Value); + } + else if (Equals(reflectedType, typeof(ushort))) + { + return (T)(object)ToUShort(Value); + } + else if (Equals(reflectedType, typeof(int))) + { + return (T)(object)ToInteger(Value); + } + else if (Equals(reflectedType, typeof(uint))) + { + return (T)(object)ToUInteger(Value); + } + else if (Equals(reflectedType, typeof(long))) + { + return (T)(object)ToLong(Value); + } + else if (Equals(reflectedType, typeof(ulong))) + { + return (T)(object)ToULong(Value); + } + else if (Equals(reflectedType, typeof(decimal))) + { + return (T)(object)ToDecimal(Value); + } + else if (Equals(reflectedType, typeof(float))) + { + return (T)(object)ToSingle(Value); + } + else if (Equals(reflectedType, typeof(double))) + { + return (T)(object)ToDouble(Value); + } + else if (Equals(reflectedType, typeof(DateTime))) + { + return (T)(object)ToDate(Value); + } + else if (Equals(reflectedType, typeof(char))) + { + return (T)(object)ToChar(Value); + } + else if (Equals(reflectedType, typeof(string))) { - return elems.Select(new RemoveNamespaceAttributesClosure(inScopePrefixes, inScopeNs, attributes).ProcessXElement); + return (T)(object)ToString(Value); } else { - return obj.Cast().Select(new RemoveNamespaceAttributesClosure(inScopePrefixes, inScopeNs, attributes).ProcessObject); + return (T)Value; } } - return obj; } + [Embedded()] [DebuggerNonUserCode()] [System.Runtime.CompilerServices.CompilerGenerated()] [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] - private sealed class RemoveNamespaceAttributesClosure + internal sealed class ProjectData { - private readonly string[] m_inScopePrefixes; - private readonly XNamespace[] m_inScopeNs; - private readonly List m_attributes; - [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] - internal RemoveNamespaceAttributesClosure(string[] inScopePrefixes, XNamespace[] inScopeNs, List attributes) + private ProjectData() + { + } + public static void SetProjectError(Exception ex) + { + } + public static void SetProjectError(Exception ex, int lErl) + { + } + public static void ClearProjectError() { - m_inScopePrefixes = inScopePrefixes; - m_inScopeNs = inScopeNs; - m_attributes = attributes; } - [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] - internal XElement ProcessXElement(XElement elem) + } + [Embedded()] + [DebuggerNonUserCode()] + [System.Runtime.CompilerServices.CompilerGenerated()] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + internal sealed class Utils + { + private Utils() { - return RemoveNamespaceAttributes(m_inScopePrefixes, m_inScopeNs, m_attributes, elem); } - [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] - internal object ProcessObject(object obj) + public static Array CopyArray(Array arySrc, Array aryDest) { - XElement elem = obj as XElement; - if (elem is not null) + if (arySrc is null) + { + return aryDest; + } + int lLength; + lLength = arySrc.Length; + if (lLength == 0) + { + return aryDest; + } + if (aryDest.Rank != arySrc.Rank) + { + throw new InvalidCastException(); + } + int iDim; + var loopTo = aryDest.Rank - 2; + for (iDim = 0; iDim <= loopTo; iDim++) { - return RemoveNamespaceAttributes(m_inScopePrefixes, m_inScopeNs, m_attributes, elem); + if (aryDest.GetUpperBound(iDim) != arySrc.GetUpperBound(iDim)) + { + throw new ArrayTypeMismatchException(); + } + } + if (lLength > aryDest.Length) + { + lLength = aryDest.Length; + } + if (arySrc.Rank > 1) + { + int LastRank = arySrc.Rank; + int lenSrcLastRank = arySrc.GetLength(LastRank - 1); + int lenDestLastRank = aryDest.GetLength(LastRank - 1); + if (lenDestLastRank == 0) + { + return aryDest; + } + int lenCopy = lenSrcLastRank > lenDestLastRank ? lenDestLastRank : lenSrcLastRank; + int i; + var loopTo1 = arySrc.Length / lenSrcLastRank - 1; + for (i = 0; i <= loopTo1; i++) + Array.Copy(arySrc, i * lenSrcLastRank, aryDest, i * lenDestLastRank, lenCopy); } else { - return obj; + Array.Copy(arySrc, aryDest, lLength); } + return aryDest; } } + [Embedded()] + [DebuggerNonUserCode()] + [System.Runtime.CompilerServices.CompilerGenerated()] [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] - public static XElement RemoveNamespaceAttributes(string[] inScopePrefixes, XNamespace[] inScopeNs, List attributes, XElement e) + internal sealed class ObjectFlowControl { - if (e is not null) + internal sealed class ForLoopControl { - var a = e.FirstAttribute; - - while (a is not null) + public static bool ForNextCheckR4(float count, float limit, float StepValue) { - var nextA = a.NextAttribute; - - if (a.IsNamespaceDeclaration) + if (StepValue >= 0f) { - var ns = a.Annotation(); - string prefix = a.Name.LocalName; - - if (ns is not null) - { - if (inScopePrefixes is not null && inScopeNs is not null) - { - int lastIndex = inScopePrefixes.Length - 1; - - for (int i = 0, loopTo = lastIndex; i <= loopTo; i++) - { - string currentInScopePrefix = inScopePrefixes[i]; - var currentInScopeNs = inScopeNs[i]; - if (prefix.Equals(currentInScopePrefix)) - { - if (ns == currentInScopeNs) - { - // prefix and namespace match. Remove the unneeded ns attribute - a.Remove(); - } - - // prefix is in scope but refers to something else. Leave the ns attribute. - a = null; - break; - } - } - } - - if (a is not null) - { - // Prefix is not in scope - // Now check whether it's going to be in scope because it is in the attributes list - - if (attributes is not null) - { - int lastIndex = attributes.Count - 1; - for (int i = 0, loopTo1 = lastIndex; i <= loopTo1; i++) - { - var currentA = attributes[i]; - string currentInScopePrefix = currentA.Name.LocalName; - var currentInScopeNs = currentA.Annotation(); - if (currentInScopeNs is not null) - { - if (prefix.Equals(currentInScopePrefix)) - { - if (ns == currentInScopeNs) - { - // prefix and namespace match. Remove the unneeded ns attribute - a.Remove(); - } - - // prefix is in scope but refers to something else. Leave the ns attribute. - a = null; - break; - } - } - } - } - - if (a is not null) - { - // Prefix is definitely not in scope - a.Remove(); - // namespace is not defined either. Add this attributes list - attributes.Add(a); - } - } - } + return count <= limit; + } + else + { + return count >= limit; + } + } + public static bool ForNextCheckR8(double count, double limit, double StepValue) + { + if (StepValue >= 0d) + { + return count <= limit; + } + else + { + return count >= limit; + } + } + public static bool ForNextCheckDec(decimal count, decimal limit, decimal StepValue) + { + if (StepValue >= 0m) + { + return count <= limit; + } + else + { + return count >= limit; } - - a = nextA; } } - return e; } - + [Embedded()] + [DebuggerNonUserCode()] + [System.Runtime.CompilerServices.CompilerGenerated()] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + internal sealed class StaticLocalInitFlag + { + public short State; + } + [Embedded()] + [DebuggerNonUserCode()] + [System.Runtime.CompilerServices.CompilerGenerated()] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + internal sealed class IncompleteInitialization : Exception + { + public IncompleteInitialization() : base() + { + } + } + [Embedded()] + [AttributeUsage(AttributeTargets.Class, Inherited = false)] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + [System.Runtime.CompilerServices.CompilerGenerated()] + internal sealed class StandardModuleAttribute : Attribute + { + } + [Embedded()] + [AttributeUsage(AttributeTargets.Class, Inherited = false)] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + [System.Runtime.CompilerServices.CompilerGenerated()] + internal sealed class DesignerGeneratedAttribute : Attribute + { + } + [Embedded()] + [AttributeUsage(AttributeTargets.Parameter, Inherited = false)] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + [System.Runtime.CompilerServices.CompilerGenerated()] + internal sealed class OptionCompareAttribute : Attribute + { + } + [Embedded()] + [AttributeUsage(AttributeTargets.Class, Inherited = false)] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + [System.Runtime.CompilerServices.CompilerGenerated()] + internal sealed class OptionTextAttribute : Attribute + { + } + } + [Embedded()] + [AttributeUsage(AttributeTargets.Class, Inherited = false)] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + [System.Runtime.CompilerServices.CompilerGenerated()] + internal sealed class HideModuleNameAttribute : Attribute + { + } + [Embedded()] + [DebuggerNonUserCode()] + [System.Runtime.CompilerServices.CompilerGenerated()] + [StandardModule] + internal static class Strings + { + public static char ChrW(int CharCode) + { + if (CharCode < -32768 || CharCode > 65535) + { + throw new ArgumentException(); + } + return Convert.ToChar(CharCode & 0xFFFF); + } + public static int AscW(string String) + { + if (String is null || String.Length == 0) + { + throw new ArgumentException(); + } + return AscW(String[0]); + } + public static int AscW(char String) + { + return AscW(String); + } + } + [Embedded()] + [DebuggerNonUserCode()] + [System.Runtime.CompilerServices.CompilerGenerated()] + [StandardModule] + internal static class Constants + { + public const string vbCrLf = Conversions.ToString(Strings.ChrW(13)) + Strings.ChrW(10); + public const string vbNewLine = Conversions.ToString(Strings.ChrW(13)) + Strings.ChrW(10); + public const string vbCr = "\r"; + public const string vbLf = "\n"; + public const string vbBack = "\b"; + public const string vbFormFeed = "\f"; + public const string vbTab = "\t"; + public const string vbVerticalTab = "\v"; + public const string vbNullChar = "\0"; + public const string vbNullString = null; } } \ No newline at end of file diff --git a/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/Prefix.VbLibrary/My Project/MyNamespace.Static.3.Designer.cs b/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/Prefix.VbLibrary/My Project/MyNamespace.Static.3.Designer.cs index 75d58675f..f1f6ad0be 100644 --- a/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/Prefix.VbLibrary/My Project/MyNamespace.Static.3.Designer.cs +++ b/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/Prefix.VbLibrary/My Project/MyNamespace.Static.3.Designer.cs @@ -1,16 +1,238 @@ +using System.Collections; +using System.Collections.Generic; +using System.Diagnostics; +using System.Linq; +using System.Xml.Linq; +using Microsoft.VisualBasic; // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. -using System; - -namespace Microsoft.VisualBasic +// See Compiler::LoadXmlSolutionExtension +namespace Prefix.VbLibrary.My { [Embedded()] - [AttributeUsage(AttributeTargets.Class | AttributeTargets.Module | AttributeTargets.Assembly, Inherited = false)] - [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + [DebuggerNonUserCode()] [System.Runtime.CompilerServices.CompilerGenerated()] - internal sealed class Embedded : Attribute + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + internal sealed class InternalXmlHelper { + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + private InternalXmlHelper() + { + } + public static string get_Value(IEnumerable source) + { + foreach (XElement item in source) + return item.Value; + return null; + } + public static void set_Value(IEnumerable source, string value) + { + foreach (XElement item in source) + { + item.Value = value; + break; + } + } + public static string get_AttributeValue(IEnumerable source, XName name) + { + foreach (XElement item in source) + return (string)item.Attribute(name); + return null; + } + public static void set_AttributeValue(IEnumerable source, XName name, string value) + { + foreach (XElement item in source) + { + item.SetAttributeValue(name, value); + break; + } + } + public static string get_AttributeValue(XElement source, XName name) + { + return (string)source.Attribute(name); + } + public static void set_AttributeValue(XElement source, XName name, string value) + { + source.SetAttributeValue(name, value); + } + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public static XAttribute CreateAttribute(XName name, object value) + { + if (value is null) + { + return null; + } + return new XAttribute(name, value); + } + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public static XAttribute CreateNamespaceAttribute(XName name, XNamespace ns) + { + var a = new XAttribute(name, ns.NamespaceName); + a.AddAnnotation(ns); + return a; + } + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public static object RemoveNamespaceAttributes(string[] inScopePrefixes, XNamespace[] inScopeNs, List attributes, object obj) + { + if (obj is not null) + { + XElement elem = obj as XElement; + if (elem is not null) + { + return RemoveNamespaceAttributes(inScopePrefixes, inScopeNs, attributes, elem); + } + else + { + IEnumerable elems = obj as IEnumerable; + if (elems is not null) + { + return RemoveNamespaceAttributes(inScopePrefixes, inScopeNs, attributes, elems); + } + } + } + return obj; + } + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public static IEnumerable RemoveNamespaceAttributes(string[] inScopePrefixes, XNamespace[] inScopeNs, List attributes, IEnumerable obj) + { + if (obj is not null) + { + IEnumerable elems = obj as IEnumerable; + if (elems is not null) + { + return elems.Select(new RemoveNamespaceAttributesClosure(inScopePrefixes, inScopeNs, attributes).ProcessXElement); + } + else + { + return obj.Cast().Select(new RemoveNamespaceAttributesClosure(inScopePrefixes, inScopeNs, attributes).ProcessObject); + } + } + return obj; + } + [DebuggerNonUserCode()] + [System.Runtime.CompilerServices.CompilerGenerated()] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + private sealed class RemoveNamespaceAttributesClosure + { + private readonly string[] m_inScopePrefixes; + private readonly XNamespace[] m_inScopeNs; + private readonly List m_attributes; + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + internal RemoveNamespaceAttributesClosure(string[] inScopePrefixes, XNamespace[] inScopeNs, List attributes) + { + m_inScopePrefixes = inScopePrefixes; + m_inScopeNs = inScopeNs; + m_attributes = attributes; + } + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + internal XElement ProcessXElement(XElement elem) + { + return RemoveNamespaceAttributes(m_inScopePrefixes, m_inScopeNs, m_attributes, elem); + } + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + internal object ProcessObject(object obj) + { + XElement elem = obj as XElement; + if (elem is not null) + { + return RemoveNamespaceAttributes(m_inScopePrefixes, m_inScopeNs, m_attributes, elem); + } + else + { + return obj; + } + } + } + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public static XElement RemoveNamespaceAttributes(string[] inScopePrefixes, XNamespace[] inScopeNs, List attributes, XElement e) + { + if (e is not null) + { + var a = e.FirstAttribute; + + while (a is not null) + { + var nextA = a.NextAttribute; + + if (a.IsNamespaceDeclaration) + { + var ns = a.Annotation(); + string prefix = a.Name.LocalName; + + if (ns is not null) + { + if (inScopePrefixes is not null && inScopeNs is not null) + { + int lastIndex = inScopePrefixes.Length - 1; + + for (int i = 0, loopTo = lastIndex; i <= loopTo; i++) + { + string currentInScopePrefix = inScopePrefixes[i]; + var currentInScopeNs = inScopeNs[i]; + if (prefix.Equals(currentInScopePrefix)) + { + if (ns == currentInScopeNs) + { + // prefix and namespace match. Remove the unneeded ns attribute + a.Remove(); + } + + // prefix is in scope but refers to something else. Leave the ns attribute. + a = null; + break; + } + } + } + + if (a is not null) + { + // Prefix is not in scope + // Now check whether it's going to be in scope because it is in the attributes list + + if (attributes is not null) + { + int lastIndex = attributes.Count - 1; + for (int i = 0, loopTo1 = lastIndex; i <= loopTo1; i++) + { + var currentA = attributes[i]; + string currentInScopePrefix = currentA.Name.LocalName; + var currentInScopeNs = currentA.Annotation(); + if (currentInScopeNs is not null) + { + if (prefix.Equals(currentInScopePrefix)) + { + if (ns == currentInScopeNs) + { + // prefix and namespace match. Remove the unneeded ns attribute + a.Remove(); + } + + // prefix is in scope but refers to something else. Leave the ns attribute. + a = null; + break; + } + } + } + } + + if (a is not null) + { + // Prefix is definitely not in scope + a.Remove(); + // namespace is not defined either. Add this attributes list + attributes.Add(a); + } + } + } + } + + a = nextA; + } + } + return e; + } + } } \ No newline at end of file diff --git a/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/Prefix.VbLibrary/Resources.Designer.cs b/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/Prefix.VbLibrary/My Project/Resources.Designer.cs similarity index 100% rename from Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/Prefix.VbLibrary/Resources.Designer.cs rename to Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/Prefix.VbLibrary/My Project/Resources.Designer.cs diff --git a/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/Prefix.VbLibrary/My Project/Settings.Designer.cs b/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/Prefix.VbLibrary/My Project/Settings.Designer.cs index 113c66ed6..fb5f4fcd3 100644 --- a/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/Prefix.VbLibrary/My Project/Settings.Designer.cs +++ b/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/Prefix.VbLibrary/My Project/Settings.Designer.cs @@ -18,11 +18,9 @@ namespace Prefix.VbLibrary.My [System.Runtime.CompilerServices.CompilerGenerated()] [System.CodeDom.Compiler.GeneratedCode("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "17.1.0.0")] [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Advanced)] - internal sealed partial class MySettings : System.Configuration.ApplicationSettingsBase + internal sealed partial class MySettings { - private static MySettings defaultInstance = (MySettings)Synchronized(new MySettings()); - #region My.Settings Auto-Save Functionality /* TODO ERROR: Skipped IfDirectiveTrivia #If _MyType = "WindowsForms" Then @@ -61,7 +59,7 @@ End If *//* TODO ERROR: Skipped EndIfDirectiveTrivia #End If */ - return defaultInstance; + return null; } } } diff --git a/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/Prefix.VbLibrary/Prefix.VbLibrary.csproj b/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/Prefix.VbLibrary/Prefix.VbLibrary.csproj index 1b110b344..43df3db8c 100644 --- a/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/Prefix.VbLibrary/Prefix.VbLibrary.csproj +++ b/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/Prefix.VbLibrary/Prefix.VbLibrary.csproj @@ -1,115 +1,9 @@ - - - + - Debug - AnyCPU - {7D8F03A6-764F-00F9-1BBA-8A41CF27F0CA} - Library Prefix.VbLibrary - Prefix.VbLibrary - 512 - Windows - v4.8 - true - + netstandard2.1 $(DefaultItemExcludes);$(ProjectDir)**\*.vb latest - - true - full - bin\Debug\ - bin\Debug\Prefix.VbLibrary.xml - 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022 - TRACE;DEBUG - - - pdbonly - true - bin\Release\ - bin\Release\Prefix.VbLibrary.xml - 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022 - TRACE - - - On - - - Binary - - - Off - - - On - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - True - Application.myapp - True - - - True - True - Resources.resx - - - True - Settings.settings - True - - - - - - - ResXFileCodeGenerator - Resources.Designer.cs - Prefix.VbLibrary.My.Resources - Designer - - - - - - MyApplicationCodeGenerator - Application.Designer.cs - - - SettingsSingleFileGenerator - Prefix.VbLibrary.My - Settings.Designer.cs - - - + \ No newline at end of file diff --git a/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/Prefix.VbLibrary/Resources.resx b/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/Prefix.VbLibrary/Resources.resx deleted file mode 100644 index 13b775f1d..000000000 --- a/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/Prefix.VbLibrary/Resources.resx +++ /dev/null @@ -1,117 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - \ No newline at end of file diff --git a/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/ConsoleApp1/AVbClass.cs b/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/VisualBasicConsoleApp/AVbClass.cs similarity index 75% rename from Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/ConsoleApp1/AVbClass.cs rename to Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/VisualBasicConsoleApp/AVbClass.cs index 6d809b5c6..112976476 100644 --- a/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/ConsoleApp1/AVbClass.cs +++ b/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/VisualBasicConsoleApp/AVbClass.cs @@ -1,5 +1,5 @@ -namespace ConsoleApp1 +namespace VisualBasicConsoleApp { static class Module1 diff --git a/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/VisualBasicConsoleApp/My Project/MyNamespace.Static.1.Designer.cs b/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/VisualBasicConsoleApp/My Project/MyNamespace.Static.1.Designer.cs new file mode 100644 index 000000000..8536d4615 --- /dev/null +++ b/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/VisualBasicConsoleApp/My Project/MyNamespace.Static.1.Designer.cs @@ -0,0 +1,385 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + + +/* TODO ERROR: Skipped IfDirectiveTrivia +#If TARGET = "module" AndAlso _MYTYPE = "" Then +*//* TODO ERROR: Skipped DisabledTextTrivia +#Const _MYTYPE="Empty" +*//* TODO ERROR: Skipped EndIfDirectiveTrivia +#End If +*/ +/* TODO ERROR: Skipped IfDirectiveTrivia +#If _MYTYPE = "WindowsForms" Then +*//* TODO ERROR: Skipped DisabledTextTrivia + +#Const _MYFORMS = True +#Const _MYWEBSERVICES = True +#Const _MYUSERTYPE = "Windows" +#Const _MYCOMPUTERTYPE = "Windows" +#Const _MYAPPLICATIONTYPE = "WindowsForms" + +*//* TODO ERROR: Skipped ElifDirectiveTrivia +#ElseIf _MYTYPE = "WindowsFormsWithCustomSubMain" Then +*//* TODO ERROR: Skipped DisabledTextTrivia + +#Const _MYFORMS = True +#Const _MYWEBSERVICES = True +#Const _MYUSERTYPE = "Windows" +#Const _MYCOMPUTERTYPE = "Windows" +#Const _MYAPPLICATIONTYPE = "Console" + +*//* TODO ERROR: Skipped ElifDirectiveTrivia +#ElseIf _MYTYPE = "Windows" OrElse _MYTYPE = "" Then +*//* TODO ERROR: Skipped DisabledTextTrivia + +#Const _MYWEBSERVICES = True +#Const _MYUSERTYPE = "Windows" +#Const _MYCOMPUTERTYPE = "Windows" +#Const _MYAPPLICATIONTYPE = "Windows" + +*//* TODO ERROR: Skipped ElifDirectiveTrivia +#ElseIf _MYTYPE = "Console" Then +*//* TODO ERROR: Skipped DisabledTextTrivia + +#Const _MYWEBSERVICES = True +#Const _MYUSERTYPE = "Windows" +#Const _MYCOMPUTERTYPE = "Windows" +#Const _MYAPPLICATIONTYPE = "Console" + +*//* TODO ERROR: Skipped ElifDirectiveTrivia +#ElseIf _MYTYPE = "Web" Then +*//* TODO ERROR: Skipped DisabledTextTrivia + +#Const _MYFORMS = False +#Const _MYWEBSERVICES = False +#Const _MYUSERTYPE = "Web" +#Const _MYCOMPUTERTYPE = "Web" + +*//* TODO ERROR: Skipped ElifDirectiveTrivia +#ElseIf _MYTYPE = "WebControl" Then +*//* TODO ERROR: Skipped DisabledTextTrivia + +#Const _MYFORMS = False +#Const _MYWEBSERVICES = True +#Const _MYUSERTYPE = "Web" +#Const _MYCOMPUTERTYPE = "Web" + +*//* TODO ERROR: Skipped ElifDirectiveTrivia +#ElseIf _MYTYPE = "Custom" Then +*//* TODO ERROR: Skipped DisabledTextTrivia + +*//* TODO ERROR: Skipped ElifDirectiveTrivia +#ElseIf _MYTYPE <> "Empty" Then +*//* TODO ERROR: Skipped DisabledTextTrivia + +#Const _MYTYPE = "Empty" + +*//* TODO ERROR: Skipped EndIfDirectiveTrivia +#End If +*/ +/* TODO ERROR: Skipped IfDirectiveTrivia +#If _MYTYPE <> "Empty" Then +*//* TODO ERROR: Skipped DisabledTextTrivia + +Namespace MergedMyNamespace50E26D7D27174AAEABCA70DEBD52E2FA + +#If _MYAPPLICATIONTYPE = "WindowsForms" OrElse _MYAPPLICATIONTYPE = "Windows" OrElse _MYAPPLICATIONTYPE = "Console" Then + + _ + Partial Friend Class MyApplication + +#If _MYAPPLICATIONTYPE = "WindowsForms" Then + Inherits Global.Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase +#If TARGET = "winexe" Then + _ + Friend Shared Sub Main(ByVal Args As String()) + Try + Global.System.Windows.Forms.Application.SetCompatibleTextRenderingDefault(MyApplication.UseCompatibleTextRendering()) + Finally + End Try + My.Application.Run(Args) + End Sub +#End If + +#ElseIf _MYAPPLICATIONTYPE = "Windows" Then + Inherits Global.Microsoft.VisualBasic.ApplicationServices.ApplicationBase +#ElseIf _MYAPPLICATIONTYPE = "Console" Then + Inherits Global.Microsoft.VisualBasic.ApplicationServices.ConsoleApplicationBase +#End If '_MYAPPLICATIONTYPE = "WindowsForms" + + End Class + +#End If '#If _MYAPPLICATIONTYPE = "WindowsForms" Or _MYAPPLICATIONTYPE = "Windows" or _MYAPPLICATIONTYPE = "Console" + +#If _MYCOMPUTERTYPE <> "" Then + + _ + Partial Friend Class MyComputer + +#If _MYCOMPUTERTYPE = "Windows" Then + Inherits Global.Microsoft.VisualBasic.Devices.Computer +#ElseIf _MYCOMPUTERTYPE = "Web" Then + Inherits Global.Microsoft.VisualBasic.Devices.ServerComputer +#End If + _ + _ + Public Sub New() + MyBase.New() + End Sub + End Class +#End If + + _ + _ + Friend Module MyProject + +#If _MYCOMPUTERTYPE <> "" Then + _ + Friend ReadOnly Property Computer() As MyComputer + _ + Get + Return m_ComputerObjectProvider.GetInstance() + End Get + End Property + + Private ReadOnly m_ComputerObjectProvider As New ThreadSafeObjectProvider(Of MyComputer) +#End If + +#If _MYAPPLICATIONTYPE = "Windows" Or _MYAPPLICATIONTYPE = "WindowsForms" Or _MYAPPLICATIONTYPE = "Console" Then + _ + Friend ReadOnly Property Application() As MyApplication + _ + Get + Return m_AppObjectProvider.GetInstance() + End Get + End Property + Private ReadOnly m_AppObjectProvider As New ThreadSafeObjectProvider(Of MyApplication) +#End If + +#If _MYUSERTYPE = "Windows" Then + _ + Friend ReadOnly Property User() As Global.Microsoft.VisualBasic.ApplicationServices.User + _ + Get + Return m_UserObjectProvider.GetInstance() + End Get + End Property + Private ReadOnly m_UserObjectProvider As New ThreadSafeObjectProvider(Of Global.Microsoft.VisualBasic.ApplicationServices.User) +#ElseIf _MYUSERTYPE = "Web" Then + _ + Friend ReadOnly Property User() As Global.Microsoft.VisualBasic.ApplicationServices.WebUser + _ + Get + Return m_UserObjectProvider.GetInstance() + End Get + End Property + Private ReadOnly m_UserObjectProvider As New ThreadSafeObjectProvider(Of Global.Microsoft.VisualBasic.ApplicationServices.WebUser) +#End If + +#If _MYFORMS = True Then + +#Const STARTUP_MY_FORM_FACTORY = "My.MyProject.Forms" + + _ + Friend ReadOnly Property Forms() As MyForms + _ + Get + Return m_MyFormsObjectProvider.GetInstance() + End Get + End Property + + _ + _ + Friend NotInheritable Class MyForms + _ + Private Shared Function Create__Instance__(Of T As {New, Global.System.Windows.Forms.Form})(ByVal Instance As T) As T + If Instance Is Nothing OrElse Instance.IsDisposed Then + If m_FormBeingCreated IsNot Nothing Then + If m_FormBeingCreated.ContainsKey(GetType(T)) = True Then + Throw New Global.System.InvalidOperationException(Global.Microsoft.VisualBasic.CompilerServices.Utils.GetResourceString("WinForms_RecursiveFormCreate")) + End If + Else + m_FormBeingCreated = New Global.System.Collections.Hashtable() + End If + m_FormBeingCreated.Add(GetType(T), Nothing) + Try + Return New T() + Catch ex As Global.System.Reflection.TargetInvocationException When ex.InnerException IsNot Nothing + Dim BetterMessage As String = Global.Microsoft.VisualBasic.CompilerServices.Utils.GetResourceString("WinForms_SeeInnerException", ex.InnerException.Message) + Throw New Global.System.InvalidOperationException(BetterMessage, ex.InnerException) + Finally + m_FormBeingCreated.Remove(GetType(T)) + End Try + Else + Return Instance + End If + End Function + + _ + Private Sub Dispose__Instance__(Of T As Global.System.Windows.Forms.Form)(ByRef instance As T) + instance.Dispose() + instance = Nothing + End Sub + + _ + _ + Public Sub New() + MyBase.New() + End Sub + + Private Shared m_FormBeingCreated As Global.System.Collections.Hashtable + + Public Overrides Function Equals(ByVal o As Object) As Boolean + Return MyBase.Equals(o) + End Function + Public Overrides Function GetHashCode() As Integer + Return MyBase.GetHashCode + End Function + _ + Friend Overloads Function [GetType]() As Global.System.Type + Return GetType(MyForms) + End Function + Public Overrides Function ToString() As String + Return MyBase.ToString + End Function + End Class + + Private m_MyFormsObjectProvider As New ThreadSafeObjectProvider(Of MyForms) + +#End If + +#If _MYWEBSERVICES = True Then + + _ + Friend ReadOnly Property WebServices() As MyWebServices + _ + Get + Return m_MyWebServicesObjectProvider.GetInstance() + End Get + End Property + + _ + _ + Friend NotInheritable Class MyWebServices + + _ + Public Overrides Function Equals(ByVal o As Object) As Boolean + Return MyBase.Equals(o) + End Function + _ + Public Overrides Function GetHashCode() As Integer + Return MyBase.GetHashCode + End Function + _ + Friend Overloads Function [GetType]() As Global.System.Type + Return GetType(MyWebServices) + End Function + _ + Public Overrides Function ToString() As String + Return MyBase.ToString + End Function + + _ + Private Shared Function Create__Instance__(Of T As {New})(ByVal instance As T) As T + If instance Is Nothing Then + Return New T() + Else + Return instance + End If + End Function + + _ + Private Sub Dispose__Instance__(Of T)(ByRef instance As T) + instance = Nothing + End Sub + + _ + _ + Public Sub New() + MyBase.New() + End Sub + End Class + + Private ReadOnly m_MyWebServicesObjectProvider As New ThreadSafeObjectProvider(Of MyWebServices) +#End If + +#If _MYTYPE = "Web" Then + + _ + Friend ReadOnly Property Request() As Global.System.Web.HttpRequest + _ + Get + Dim CurrentContext As Global.System.Web.HttpContext = Global.System.Web.HttpContext.Current + If CurrentContext IsNot Nothing Then + Return CurrentContext.Request + End If + Return Nothing + End Get + End Property + + _ + Friend ReadOnly Property Response() As Global.System.Web.HttpResponse + _ + Get + Dim CurrentContext As Global.System.Web.HttpContext = Global.System.Web.HttpContext.Current + If CurrentContext IsNot Nothing Then + Return CurrentContext.Response + End If + Return Nothing + End Get + End Property + + _ + Friend ReadOnly Property Log() As Global.Microsoft.VisualBasic.Logging.AspLog + _ + Get + Return m_LogObjectProvider.GetInstance() + End Get + End Property + + Private ReadOnly m_LogObjectProvider As New ThreadSafeObjectProvider(Of Global.Microsoft.VisualBasic.Logging.AspLog) + +#End If '_MYTYPE="Web" + + _ + _ + Friend NotInheritable Class ThreadSafeObjectProvider(Of T As New) + Friend ReadOnly Property GetInstance() As T +#If TARGET = "library" Then + _ + Get + Dim Value As T = m_Context.Value + If Value Is Nothing Then + Value = New T + m_Context.Value() = Value + End If + Return Value + End Get +#Else + _ + Get + If m_ThreadStaticValue Is Nothing Then m_ThreadStaticValue = New T + Return m_ThreadStaticValue + End Get +#End If + End Property + + _ + _ + Public Sub New() + MyBase.New() + End Sub + +#If TARGET = "library" Then + Private ReadOnly m_Context As New Global.Microsoft.VisualBasic.MyServices.Internal.ContextValue(Of T) +#Else + Private Shared m_ThreadStaticValue As T +#End If + End Class + End Module +End Namespace +*//* TODO ERROR: Skipped EndIfDirectiveTrivia +#End If +*/ \ No newline at end of file diff --git a/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/WindowsAppVb/My Project/MyNamespace.Static.2.Designer.cs b/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/VisualBasicConsoleApp/My Project/MyNamespace.Static.2.Designer.cs similarity index 99% rename from Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/WindowsAppVb/My Project/MyNamespace.Static.2.Designer.cs rename to Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/VisualBasicConsoleApp/My Project/MyNamespace.Static.2.Designer.cs index b53428969..0bd773a49 100644 --- a/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/WindowsAppVb/My Project/MyNamespace.Static.2.Designer.cs +++ b/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/VisualBasicConsoleApp/My Project/MyNamespace.Static.2.Designer.cs @@ -1,6 +1,5 @@ using System.Collections; using System.Collections.Generic; -using System.Data; using System.Diagnostics; using System.Linq; using System.Xml.Linq; @@ -10,7 +9,7 @@ // See the LICENSE file in the project root for more information. // See Compiler::LoadXmlSolutionExtension -namespace WindowsAppVb.My +namespace VisualBasicConsoleApp.My { [Embedded()] [DebuggerNonUserCode()] diff --git a/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/ConsoleApp1/My Project/MyNamespace.Static.3.Designer.cs b/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/VisualBasicConsoleApp/My Project/MyNamespace.Static.3.Designer.cs similarity index 100% rename from Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/ConsoleApp1/My Project/MyNamespace.Static.3.Designer.cs rename to Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/VisualBasicConsoleApp/My Project/MyNamespace.Static.3.Designer.cs diff --git a/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/VisualBasicConsoleApp/VisualBasicConsoleApp.csproj b/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/VisualBasicConsoleApp/VisualBasicConsoleApp.csproj new file mode 100644 index 000000000..f2f12a921 --- /dev/null +++ b/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/VisualBasicConsoleApp/VisualBasicConsoleApp.csproj @@ -0,0 +1,13 @@ + + + Exe + VisualBasicConsoleApp + net10.0 + $(DefaultItemExcludes);$(ProjectDir)**\*.vb + latest + + + + + + \ No newline at end of file diff --git a/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/WinFormsAppVb/ApplicationEvents.cs b/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/WinFormsAppVb/ApplicationEvents.cs new file mode 100644 index 000000000..50ffd805a --- /dev/null +++ b/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/WinFormsAppVb/ApplicationEvents.cs @@ -0,0 +1,30 @@ + +namespace WinFormsAppVb.My +{ + // The following events are available for MyApplication: + // Startup: Raised when the application starts, before the startup form is created. + // Shutdown: Raised after all application forms are closed. This event is not raised if the application terminates abnormally. + // UnhandledException: Raised if the application encounters an unhandled exception. + // StartupNextInstance: Raised when launching a single-instance application and the application is already active. + // NetworkAvailabilityChanged: Raised when the network connection is connected or disconnected. + + // **NEW** ApplyApplicationDefaults: Raised when the application queries default values to be set for the application. + + // Example: + // Private Sub MyApplication_ApplyApplicationDefaults(sender As Object, e As ApplyApplicationDefaultsEventArgs) Handles Me.ApplyApplicationDefaults + // + // ' Setting the application-wide default Font: + // e.Font = New Font(FontFamily.GenericSansSerif, 12, FontStyle.Regular) + // + // ' Setting the HighDpiMode for the Application: + // e.HighDpiMode = HighDpiMode.PerMonitorV2 + // + // ' If a splash dialog is used, this sets the minimum display time: + // e.MinimumSplashScreenDisplayTime = 4000 + // End Sub + + internal partial class MyApplication + { + + } +} \ No newline at end of file diff --git a/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/WindowsAppVb/Folder/FolderForm.Designer.cs b/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/WinFormsAppVb/Folder/FolderForm.Designer.cs similarity index 99% rename from Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/WindowsAppVb/Folder/FolderForm.Designer.cs rename to Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/WinFormsAppVb/Folder/FolderForm.Designer.cs index b90e7372a..5e8fc55ab 100644 --- a/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/WindowsAppVb/Folder/FolderForm.Designer.cs +++ b/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/WinFormsAppVb/Folder/FolderForm.Designer.cs @@ -3,7 +3,7 @@ using System.Drawing; using System.Windows.Forms; -namespace WindowsAppVb +namespace WinFormsAppVb { [Microsoft.VisualBasic.CompilerServices.DesignerGenerated()] public partial class FolderForm : Form diff --git a/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/WindowsAppVb/Folder/FolderForm.cs b/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/WinFormsAppVb/Folder/FolderForm.cs similarity index 98% rename from Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/WindowsAppVb/Folder/FolderForm.cs rename to Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/WinFormsAppVb/Folder/FolderForm.cs index fb92c16e3..4589f3e78 100644 --- a/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/WindowsAppVb/Folder/FolderForm.cs +++ b/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/WinFormsAppVb/Folder/FolderForm.cs @@ -5,7 +5,7 @@ using System.Threading; using VbNetStandardLib.My.Resources; -namespace WindowsAppVb +namespace WinFormsAppVb { public partial class FolderForm diff --git a/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/WindowsAppVb/Resource2.Designer.cs b/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/WinFormsAppVb/Folder/Resource2.Designer.cs similarity index 97% rename from Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/WindowsAppVb/Resource2.Designer.cs rename to Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/WinFormsAppVb/Folder/Resource2.Designer.cs index 9434b0c90..49c0825bc 100644 --- a/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/WindowsAppVb/Resource2.Designer.cs +++ b/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/WinFormsAppVb/Folder/Resource2.Designer.cs @@ -12,7 +12,7 @@ using System.Diagnostics; using System.Drawing; -namespace WindowsAppVb.My.Resources +namespace WinFormsAppVb.My.Resources { // This class was auto-generated by the StronglyTypedResourceBuilder @@ -47,7 +47,7 @@ internal static System.Resources.ResourceManager ResourceManager { if (ReferenceEquals(resourceMan, null)) { - var temp = new System.Resources.ResourceManager("WindowsAppVb.Resource2", typeof(Resource2).Assembly); + var temp = new System.Resources.ResourceManager("WinFormsAppVb.Resource2", typeof(Resource2).Assembly); resourceMan = temp; } return resourceMan; diff --git a/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/WindowsAppVb/Resource3.Designer.cs b/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/WinFormsAppVb/Folder2/Resource3.Designer.cs similarity index 97% rename from Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/WindowsAppVb/Resource3.Designer.cs rename to Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/WinFormsAppVb/Folder2/Resource3.Designer.cs index a3ae0abdf..c6b74f6fd 100644 --- a/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/WindowsAppVb/Resource3.Designer.cs +++ b/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/WinFormsAppVb/Folder2/Resource3.Designer.cs @@ -12,7 +12,7 @@ using System.Diagnostics; using System.Drawing; -namespace WindowsAppVb.My.Resources +namespace WinFormsAppVb.My.Resources { // This class was auto-generated by the StronglyTypedResourceBuilder @@ -47,7 +47,7 @@ internal static System.Resources.ResourceManager ResourceManager { if (ReferenceEquals(resourceMan, null)) { - var temp = new System.Resources.ResourceManager("WindowsAppVb.Resource3", typeof(Resource3).Assembly); + var temp = new System.Resources.ResourceManager("WinFormsAppVb.Resource3", typeof(Resource3).Assembly); resourceMan = temp; } return resourceMan; diff --git a/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/WinFormsAppVb/Form1.Designer.cs b/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/WinFormsAppVb/Form1.Designer.cs new file mode 100644 index 000000000..a9c25a2bd --- /dev/null +++ b/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/WinFormsAppVb/Form1.Designer.cs @@ -0,0 +1,44 @@ +using System.Diagnostics; +using System.Drawing; +using System.Windows.Forms; + +namespace WinFormsAppVb +{ + [Microsoft.VisualBasic.CompilerServices.DesignerGenerated()] + public partial class Form1 : Form + { + + // Form overrides dispose to clean up the component list. + [DebuggerNonUserCode()] + protected override void Dispose(bool disposing) + { + try + { + if (disposing && components is not null) + { + components.Dispose(); + } + } + finally + { + base.Dispose(disposing); + } + } + + // Required by the Windows Form Designer + private System.ComponentModel.IContainer components; + + // NOTE: The following procedure is required by the Windows Form Designer + // It can be modified using the Windows Form Designer. + // Do not modify it using the code editor. + [DebuggerStepThrough()] + private void InitializeComponent() + { + components = new System.ComponentModel.Container(); + AutoScaleMode = AutoScaleMode.Font; + ClientSize = new Size(800, 450); + Text = "Form1"; + } + + } +} \ No newline at end of file diff --git a/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/WinFormsAppVb/Form1.cs b/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/WinFormsAppVb/Form1.cs new file mode 100644 index 000000000..d577c9ff2 --- /dev/null +++ b/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/WinFormsAppVb/Form1.cs @@ -0,0 +1,12 @@ + +namespace WinFormsAppVb +{ + public partial class Form1 + { + public Form1() + { + InitializeComponent(); + } + + } +} \ No newline at end of file diff --git a/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/WindowsAppVb/My Project/Application.Designer.cs b/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/WinFormsAppVb/My Project/Application.Designer.cs similarity index 98% rename from Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/WindowsAppVb/My Project/Application.Designer.cs rename to Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/WinFormsAppVb/My Project/Application.Designer.cs index 08d3eb6c2..da7fd0241 100644 --- a/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/WindowsAppVb/My Project/Application.Designer.cs +++ b/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/WinFormsAppVb/My Project/Application.Designer.cs @@ -10,7 +10,7 @@ using System.Diagnostics; -namespace WindowsAppVb.My +namespace WinFormsAppVb.My { // NOTE: This file is auto-generated; do not modify it directly. To make changes, diff --git a/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/WindowsAppVb/My Project/MyNamespace.Dynamic.Designer.cs b/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/WinFormsAppVb/My Project/MyNamespace.Dynamic.Designer.cs similarity index 70% rename from Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/WindowsAppVb/My Project/MyNamespace.Dynamic.Designer.cs rename to Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/WinFormsAppVb/My Project/MyNamespace.Dynamic.Designer.cs index 112cae880..06b9c7e18 100644 --- a/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/WindowsAppVb/My Project/MyNamespace.Dynamic.Designer.cs +++ b/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/WinFormsAppVb/My Project/MyNamespace.Dynamic.Designer.cs @@ -2,7 +2,7 @@ using System.ComponentModel; using System.Diagnostics; -namespace WindowsAppVb.My +namespace WinFormsAppVb.My { internal static partial class MyProject { @@ -32,6 +32,29 @@ public FolderForm FolderForm } + [EditorBrowsable(EditorBrowsableState.Never)] + public Form1 m_Form1; + + public Form1 Form1 + { + [DebuggerHidden] + get + { + m_Form1 = Create__Instance__(m_Form1); + return m_Form1; + } + [DebuggerHidden] + set + { + if (ReferenceEquals(value, m_Form1)) + return; + if (value is not null) + throw new ArgumentException("Property can only be set to Nothing"); + Dispose__Instance__(ref m_Form1); + } + } + + [EditorBrowsable(EditorBrowsableState.Never)] public WinformsDesignerTest m_WinformsDesignerTest; diff --git a/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/WindowsAppVb/My Project/MyNamespace.Static.1.Designer.cs b/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/WinFormsAppVb/My Project/MyNamespace.Static.1.Designer.cs similarity index 99% rename from Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/WindowsAppVb/My Project/MyNamespace.Static.1.Designer.cs rename to Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/WinFormsAppVb/My Project/MyNamespace.Static.1.Designer.cs index 693910fe0..6f8acac3f 100644 --- a/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/WindowsAppVb/My Project/MyNamespace.Static.1.Designer.cs +++ b/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/WinFormsAppVb/My Project/MyNamespace.Static.1.Designer.cs @@ -91,7 +91,7 @@ /* TODO ERROR: Skipped IfDirectiveTrivia #If _MYTYPE <> "Empty" Then */ -namespace WindowsAppVb.My +namespace WinFormsAppVb.My { /* TODO ERROR: Skipped IfDirectiveTrivia diff --git a/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/ConsoleApp1/My Project/MyNamespace.Static.2.Designer.cs b/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/WinFormsAppVb/My Project/MyNamespace.Static.2.Designer.cs similarity index 99% rename from Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/ConsoleApp1/My Project/MyNamespace.Static.2.Designer.cs rename to Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/WinFormsAppVb/My Project/MyNamespace.Static.2.Designer.cs index 05c0af1bc..c72ccfc30 100644 --- a/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/ConsoleApp1/My Project/MyNamespace.Static.2.Designer.cs +++ b/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/WinFormsAppVb/My Project/MyNamespace.Static.2.Designer.cs @@ -10,7 +10,7 @@ // See the LICENSE file in the project root for more information. // See Compiler::LoadXmlSolutionExtension -namespace ConsoleApp1.My +namespace WinFormsAppVb.My { [Embedded()] [DebuggerNonUserCode()] diff --git a/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/WindowsAppVb/My Project/MyNamespace.Static.3.Designer.cs b/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/WinFormsAppVb/My Project/MyNamespace.Static.3.Designer.cs similarity index 100% rename from Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/WindowsAppVb/My Project/MyNamespace.Static.3.Designer.cs rename to Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/WinFormsAppVb/My Project/MyNamespace.Static.3.Designer.cs diff --git a/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/WindowsAppVb/Resources.Designer.cs b/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/WinFormsAppVb/My Project/Resources.Designer.cs similarity index 98% rename from Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/WindowsAppVb/Resources.Designer.cs rename to Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/WinFormsAppVb/My Project/Resources.Designer.cs index 3483637a9..bc2676ad4 100644 --- a/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/WindowsAppVb/Resources.Designer.cs +++ b/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/WinFormsAppVb/My Project/Resources.Designer.cs @@ -13,7 +13,7 @@ using System.Drawing; using Microsoft.VisualBasic; -namespace WindowsAppVb.My.Resources +namespace WinFormsAppVb.My.Resources { // This class was auto-generated by the StronglyTypedResourceBuilder diff --git a/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/WindowsAppVb/My Project/Settings.Designer.cs b/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/WinFormsAppVb/My Project/Settings.Designer.cs similarity index 98% rename from Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/WindowsAppVb/My Project/Settings.Designer.cs rename to Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/WinFormsAppVb/My Project/Settings.Designer.cs index 0e656ea39..57b5d2762 100644 --- a/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/WindowsAppVb/My Project/Settings.Designer.cs +++ b/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/WinFormsAppVb/My Project/Settings.Designer.cs @@ -13,7 +13,7 @@ using Microsoft.VisualBasic; -namespace WindowsAppVb.My +namespace WinFormsAppVb.My { [System.Runtime.CompilerServices.CompilerGenerated()] @@ -74,7 +74,7 @@ public static MySettings Default } } -namespace WindowsAppVb.My +namespace WinFormsAppVb.My { [HideModuleName()] diff --git a/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/WindowsAppVb/ReferencingFormThroughStatic.cs b/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/WinFormsAppVb/ReferencingFormThroughStatic.cs similarity index 96% rename from Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/WindowsAppVb/ReferencingFormThroughStatic.cs rename to Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/WinFormsAppVb/ReferencingFormThroughStatic.cs index dd3bd408f..28869548b 100644 --- a/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/WindowsAppVb/ReferencingFormThroughStatic.cs +++ b/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/WinFormsAppVb/ReferencingFormThroughStatic.cs @@ -1,5 +1,5 @@ -namespace WindowsAppVb +namespace WinFormsAppVb { public static class ReferencingFormThroughStatic { diff --git a/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/WindowsAppVb/Resource1.Designer.cs b/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/WinFormsAppVb/Resource1.Designer.cs similarity index 97% rename from Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/WindowsAppVb/Resource1.Designer.cs rename to Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/WinFormsAppVb/Resource1.Designer.cs index 02b2f10ab..107504b84 100644 --- a/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/WindowsAppVb/Resource1.Designer.cs +++ b/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/WinFormsAppVb/Resource1.Designer.cs @@ -13,7 +13,7 @@ using System.Drawing; using System.Runtime.CompilerServices; -namespace WindowsAppVb.My.Resources +namespace WinFormsAppVb.My.Resources { // This class was auto-generated by the StronglyTypedResourceBuilder @@ -48,7 +48,7 @@ public static System.Resources.ResourceManager ResourceManager { if (ReferenceEquals(resourceMan, null)) { - var temp = new System.Resources.ResourceManager("WindowsAppVb.Resource1", typeof(Resource1).Assembly); + var temp = new System.Resources.ResourceManager("WinFormsAppVb.Resource1", typeof(Resource1).Assembly); resourceMan = temp; } return resourceMan; diff --git a/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/WindowsAppVb/Resource1.en-US.Designer.cs b/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/WinFormsAppVb/Resource1.en-US.Designer.cs similarity index 100% rename from Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/WindowsAppVb/Resource1.en-US.Designer.cs rename to Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/WinFormsAppVb/Resource1.en-US.Designer.cs diff --git a/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/WinFormsAppVb/WinFormsAppVb.csproj b/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/WinFormsAppVb/WinFormsAppVb.csproj new file mode 100644 index 000000000..55b177ff0 --- /dev/null +++ b/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/WinFormsAppVb/WinFormsAppVb.csproj @@ -0,0 +1,33 @@ + + + WinExe + net10.0-windows + Sub Main + true + WindowsForms + $(DefaultItemExcludes);$(ProjectDir)**\*.vb + latest + + + + + + + + + + + + + True + True + Application.myapp + + + + + MyApplicationCodeGenerator + Application.Designer.cs + + + \ No newline at end of file diff --git a/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/WindowsAppVb/WinformsDesignerTest.Designer.cs b/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/WinFormsAppVb/WinformsDesignerTest.Designer.cs similarity index 99% rename from Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/WindowsAppVb/WinformsDesignerTest.Designer.cs rename to Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/WinFormsAppVb/WinformsDesignerTest.Designer.cs index 0320cdd42..15dc2cdec 100644 --- a/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/WindowsAppVb/WinformsDesignerTest.Designer.cs +++ b/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/WinFormsAppVb/WinformsDesignerTest.Designer.cs @@ -4,7 +4,7 @@ using System.Runtime.InteropServices; using System.Windows.Forms; -namespace WindowsAppVb +namespace WinFormsAppVb { [Microsoft.VisualBasic.CompilerServices.DesignerGenerated()] public partial class WinformsDesignerTest : Form diff --git a/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/WindowsAppVb/WinformsDesignerTest.cs b/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/WinFormsAppVb/WinformsDesignerTest.cs similarity index 99% rename from Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/WindowsAppVb/WinformsDesignerTest.cs rename to Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/WinFormsAppVb/WinformsDesignerTest.cs index 67e5bc4ce..880ee48ab 100644 --- a/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/WindowsAppVb/WinformsDesignerTest.cs +++ b/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/WinFormsAppVb/WinformsDesignerTest.cs @@ -1,7 +1,7 @@ using System; using System.Windows.Forms; -namespace WindowsAppVb +namespace WinFormsAppVb { public partial class WinformsDesignerTest { diff --git a/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/WindowsAppVb/My Project/AssemblyInfo.cs b/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/WindowsAppVb/My Project/AssemblyInfo.cs deleted file mode 100644 index b1f7767ca..000000000 --- a/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/WindowsAppVb/My Project/AssemblyInfo.cs +++ /dev/null @@ -1,35 +0,0 @@ -using System; -using System.Reflection; -using System.Runtime.InteropServices; - -// 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. - -// Review the values of the assembly attributes - -[assembly: AssemblyTitle("WindowsAppVb")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("WindowsAppVb")] -[assembly: AssemblyCopyright("Copyright © 2018")] -[assembly: AssemblyTrademark("")] - -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("90704646-cc33-4bd5-b762-cf4fff7331da")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// 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.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/WindowsAppVb/Resource2.resx b/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/WindowsAppVb/Resource2.resx deleted file mode 100644 index cc8848ab6..000000000 --- a/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/WindowsAppVb/Resource2.resx +++ /dev/null @@ -1,133 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - AnotherString - - - - test.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - Folder\test2.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - Folder2\test3.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - \ No newline at end of file diff --git a/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/WindowsAppVb/Resource3.en-US.resx b/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/WindowsAppVb/Resource3.en-US.resx deleted file mode 100644 index c9e68dfc3..000000000 --- a/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/WindowsAppVb/Resource3.en-US.resx +++ /dev/null @@ -1,133 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - AStringinUSLocale - - - - test.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - Folder\test2.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - Folder2\test3.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - \ No newline at end of file diff --git a/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/WindowsAppVb/Resource3.resx b/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/WindowsAppVb/Resource3.resx deleted file mode 100644 index fe8043c2e..000000000 --- a/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/WindowsAppVb/Resource3.resx +++ /dev/null @@ -1,133 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - AString - - - - test.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - Folder\test2.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - Folder2\test3.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - \ No newline at end of file diff --git a/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/WindowsAppVb/Resources.resx b/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/WindowsAppVb/Resources.resx deleted file mode 100644 index 7a682428b..000000000 --- a/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/WindowsAppVb/Resources.resx +++ /dev/null @@ -1,130 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - - test.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - Folder\test2.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - Folder2\test3.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - \ No newline at end of file diff --git a/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/WindowsAppVb/WindowsAppVb.csproj b/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/WindowsAppVb/WindowsAppVb.csproj deleted file mode 100644 index 858fea0a9..000000000 --- a/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/WindowsAppVb/WindowsAppVb.csproj +++ /dev/null @@ -1,195 +0,0 @@ - - - - - Debug - AnyCPU - {63AE39F6-D4CF-0888-2B6F-3EF803778218} - WinExe - WindowsAppVb.My.MyApplication - WindowsAppVb - WindowsAppVb - 512 - WindowsForms - v4.8 - true - - $(DefaultItemExcludes);$(ProjectDir)**\*.vb - latest - - - AnyCPU - true - full - bin\Debug\ - bin\Debug\WindowsAppVb.xml - 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022 - TRACE;DEBUG - - - AnyCPU - pdbonly - true - bin\Release\ - bin\Release\WindowsAppVb.xml - 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022 - TRACE - - - On - - - Binary - - - Off - - - On - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - True - True - Resource3.resx - - - FolderForm.cs - - - Form - - - True - True - Resource2.resx - - - - True - True - Resource1.resx - - - True - True - Resource1.en-US.resx - - - Form - - - WinformsDesignerTest.cs - Form - - - - True - Application.myapp - True - - - True - True - Resources.resx - - - True - Settings.settings - True - - - - - - WindowsAppVb.My.Resources - ResXFileCodeGenerator - Resource3.Designer.cs - - - FolderForm.cs - - - WindowsAppVb.My.Resources - ResXFileCodeGenerator - Resource2.Designer.cs - - - PublicResXFileCodeGenerator - Resource1.en-US.Designer.cs - WindowsAppVb.My.Resources - - - WindowsAppVb.My.Resources - PublicResXFileCodeGenerator - Resource1.Designer.cs - - - WinformsDesignerTest.cs - - - ResXFileCodeGenerator - Resources.Designer.cs - WindowsAppVb.My.Resources - Designer - - - - - MyApplicationCodeGenerator - Application.Designer.cs - - - SettingsSingleFileGenerator - WindowsAppVb.My - Settings.Designer.cs - - - - - - - - - - - - - - - {49DF6752-696A-0F7B-1455-E2F06769DFAE} - VbNetStandardLib - - - - \ No newline at end of file diff --git a/Tests/TestRunners/ConverterTestBase.cs b/Tests/TestRunners/ConverterTestBase.cs index a1ea27b37..e43a70e25 100644 --- a/Tests/TestRunners/ConverterTestBase.cs +++ b/Tests/TestRunners/ConverterTestBase.cs @@ -36,22 +36,27 @@ public ConverterTestBase(string rootNamespace = null) .WithOptionCompareText(false) .WithOptionStrict(OptionStrict.Off) .WithOptionInfer(true); - EmptyNamespaceOptionStrictOff = new TextConversionOptions(DefaultReferences.NetStandard2) { + EmptyNamespaceOptionStrictOff = new TextConversionOptions(References) { RootNamespaceOverride = string.Empty, TargetCompilationOptionsOverride = options, ShowCompilationErrors = true }; - VisualBasic11 = new TextConversionOptions(DefaultReferences.NetStandard2) { + VisualBasic11 = new TextConversionOptions(References) { RootNamespaceOverride = string.Empty, TargetCompilationOptionsOverride = options.WithParseOptions(new VisualBasicParseOptions(LanguageVersion.VisualBasic11)), ShowCompilationErrors = true }; } + private static IReadOnlyCollection References { get; } = DefaultReferences.With( + typeof(System.Windows.Forms.Form).Assembly, + typeof(Microsoft.VisualBasic.Devices.Computer).Assembly + ); + public async Task TestConversionCSharpToVisualBasicAsync(string csharpCode, string expectedVisualBasicCode, bool expectSurroundingMethodBlock = false, bool expectCompilationErrors = false, TextConversionOptions conversionOptions = null, bool hasLineCommentConversionIssue = false) { expectedVisualBasicCode = AddSurroundingMethodBlock(expectedVisualBasicCode, expectSurroundingMethodBlock); - conversionOptions ??= new TextConversionOptions(DefaultReferences.NetStandard2) { ShowCompilationErrors = !expectSurroundingMethodBlock }; + conversionOptions ??= new TextConversionOptions(References) { ShowCompilationErrors = !expectSurroundingMethodBlock }; await AssertConvertedCodeResultEqualsAsync(csharpCode, expectedVisualBasicCode, conversionOptions); if (_testCstoVbCommentsByDefault && !hasLineCommentConversionIssue) { await AssertLineCommentsConvertedInSameOrderAsync(csharpCode, conversionOptions, "//", LineCanHaveCSharpComment); @@ -109,7 +114,7 @@ public async Task TestConversionVisualBasicToCSharpAsync(string visualBasicCode, bool incompatibleWithAutomatedCommentTesting = false) { if (expectSurroundingBlock) expectedCsharpCode = SurroundWithBlock(expectedCsharpCode); - var conversionOptions = new TextConversionOptions(DefaultReferences.NetStandard2) { + var conversionOptions = new TextConversionOptions(References) { RootNamespaceOverride = _rootNamespace, ShowCompilationErrors = !expectSurroundingBlock }; @@ -143,7 +148,7 @@ private static string SurroundWithBlock(string expectedCsharpCode) protected async Task ConvertAsync(string inputCode, TextConversionOptions conversionOptions = default) where TLanguageConversion : ILanguageConversion, new() { - var textConversionOptions = conversionOptions ?? new TextConversionOptions(DefaultReferences.NetStandard2) { RootNamespaceOverride = _rootNamespace, ShowCompilationErrors = true }; + var textConversionOptions = conversionOptions ?? new TextConversionOptions(References) { RootNamespaceOverride = _rootNamespace, ShowCompilationErrors = true }; var conversionResult = await ProjectConversion.ConvertTextAsync(inputCode, textConversionOptions); return (conversionResult.ConvertedCode ?? "") + (conversionResult.GetExceptionsAsString() ?? ""); } diff --git a/Tests/TestRunners/MultiFileTestFixture.cs b/Tests/TestRunners/MultiFileTestFixture.cs index c5bb6f140..04f5c1f59 100644 --- a/Tests/TestRunners/MultiFileTestFixture.cs +++ b/Tests/TestRunners/MultiFileTestFixture.cs @@ -41,7 +41,7 @@ public sealed class MultiFileTestFixture : ICollectionFixture shouldConvertProject, Language targetLanguage, [CallerMemberName] string expectedResultsDirectory = "") { diff --git a/Tests/TestRunners/TestFileRewriter.cs b/Tests/TestRunners/TestFileRewriter.cs index b49ddd64e..f05e80758 100644 --- a/Tests/TestRunners/TestFileRewriter.cs +++ b/Tests/TestRunners/TestFileRewriter.cs @@ -19,7 +19,7 @@ private static Dictionary GetTestFileContents() private static string GetTestSourceDirectoryPath() { - string assemblyDir = Path.GetDirectoryName(new Uri(Assembly.GetExecutingAssembly().CodeBase).AbsolutePath); + string assemblyDir = Path.GetDirectoryName(new Uri(Assembly.GetExecutingAssembly().Location).AbsolutePath); string testSourceDirectoryPath = Path.Combine(assemblyDir, @"..\..\"); return testSourceDirectoryPath; } diff --git a/Tests/Tests.csproj b/Tests/Tests.csproj index aceb8e292..e4562cf2c 100644 --- a/Tests/Tests.csproj +++ b/Tests/Tests.csproj @@ -1,28 +1,38 @@  - net472 + net10.0-windows Library ICSharpCode.CodeConverter.Tests ICSharpCode.CodeConverter.Tests true true true + true + NU1510;NU1903 - - - - - - + + + + all runtime; build; native; contentfiles; analyzers; buildtransitive - + runtime; build; native; contentfiles; analyzers; buildtransitive all + + + + + + + + + + @@ -34,17 +44,6 @@ - - - - - - - - - - - - + diff --git a/Tests/VB/MemberTests.cs b/Tests/VB/MemberTests.cs index 6864da4b2..0e5ab1364 100644 --- a/Tests/VB/MemberTests.cs +++ b/Tests/VB/MemberTests.cs @@ -968,11 +968,10 @@ await TestConversionCSharpToVisualBasicAsync( Private Shared Function OpenProcess(dwDesiredAccess As AccessMask, bInheritHandle As Boolean, dwProcessId As UInteger) As IntPtr End Function -4 source compilation errors: +3 source compilation errors: CS0246: The type or namespace name 'AccessMask' could not be found (are you missing a using directive or an assembly reference?) CS0246: The type or namespace name 'DllImportAttribute' could not be found (are you missing a using directive or an assembly reference?) CS0246: The type or namespace name 'DllImport' could not be found (are you missing a using directive or an assembly reference?) -CS0246: The type or namespace name 'SetLastError' could not be found (are you missing a using directive or an assembly reference?) 1 target compilation errors: BC30002: Type 'AccessMask' is not defined."); } @@ -1308,12 +1307,12 @@ End Class 15 source compilation errors: CS1002: ; expected -CS0535: 'TestClass' does not implement interface member 'IList.Add(object)' -CS0535: 'TestClass' does not implement interface member 'IList.Contains(object)' +CS0535: 'TestClass' does not implement interface member 'IList.Add(object?)' +CS0535: 'TestClass' does not implement interface member 'IList.Contains(object?)' CS0535: 'TestClass' does not implement interface member 'IList.Clear()' -CS0535: 'TestClass' does not implement interface member 'IList.IndexOf(object)' -CS0535: 'TestClass' does not implement interface member 'IList.Insert(int, object)' -CS0535: 'TestClass' does not implement interface member 'IList.Remove(object)' +CS0535: 'TestClass' does not implement interface member 'IList.IndexOf(object?)' +CS0535: 'TestClass' does not implement interface member 'IList.Insert(int, object?)' +CS0535: 'TestClass' does not implement interface member 'IList.Remove(object?)' CS0535: 'TestClass' does not implement interface member 'IList.RemoveAt(int)' CS0535: 'TestClass' does not implement interface member 'IList.IsReadOnly' CS0535: 'TestClass' does not implement interface member 'IList.IsFixedSize' diff --git a/Tests/VB/MultiFileSolutionAndProjectTests.cs b/Tests/VB/MultiFileSolutionAndProjectTests.cs index 842ba3ab1..e871bca9e 100644 --- a/Tests/VB/MultiFileSolutionAndProjectTests.cs +++ b/Tests/VB/MultiFileSolutionAndProjectTests.cs @@ -18,14 +18,14 @@ public MultiFileSolutionAndProjectTests(MultiFileTestFixture multiFileTestFixtur _multiFileTestFixture = multiFileTestFixture; } - [Fact(Skip = "CI system cannot run this at the moment due to installed SDK versions")] + [Fact()] public async Task ConvertWholeSolutionAsync() { //the `CSharpRefReturn` project is excluded because it has ref return properties which are not supported in VB await _multiFileTestFixture.ConvertProjectsWhereAsync(p => p.Name != "CSharpRefReturn", Language.VB); } - [Fact(Skip = "CI system cannot run this at the moment due to installed SDK versions")] + [Fact()] public async Task ConvertCSharpConsoleAppOnlyAsync() { await _multiFileTestFixture.ConvertProjectsWhereAsync(p => p.Name == "CSharpConsoleApp", Language.VB); diff --git a/Tests/VB/NamespaceLevelTests.cs b/Tests/VB/NamespaceLevelTests.cs index 3b8c09c25..0ab313e55 100644 --- a/Tests/VB/NamespaceLevelTests.cs +++ b/Tests/VB/NamespaceLevelTests.cs @@ -443,7 +443,7 @@ Implements IComparable End Class 1 source compilation errors: -CS0535: 'test' does not implement interface member 'IComparable.CompareTo(object)' +CS0535: 'test' does not implement interface member 'IComparable.CompareTo(object?)' 1 target compilation errors: BC30149: Class 'test' must implement 'Function CompareTo(obj As Object) As Integer' for interface 'IComparable'."); } diff --git a/Tests/VB/StandaloneStatementTests.cs b/Tests/VB/StandaloneStatementTests.cs index 9baf185c6..f61413664 100644 --- a/Tests/VB/StandaloneStatementTests.cs +++ b/Tests/VB/StandaloneStatementTests.cs @@ -1,5 +1,4 @@ using System.Threading.Tasks; -using System.Windows.Forms; using ICSharpCode.CodeConverter.Tests.TestRunners; using Xunit; @@ -53,7 +52,7 @@ await TestConversionCSharpToVisualBasicAsync( End Sub 1 source compilation errors: -CS7036: There is no argument given that corresponds to the required formal parameter 'validOn' of 'AttributeUsageAttribute.AttributeUsageAttribute(AttributeTargets)' +CS7036: There is no argument given that corresponds to the required parameter 'validOn' of 'AttributeUsageAttribute.AttributeUsageAttribute(AttributeTargets)' 1 target compilation errors: BC30455: Argument not specified for parameter 'validOn' of 'Public Overloads Sub New(validOn As AttributeTargets)'."); } diff --git a/Tests/VB/StatementTests.cs b/Tests/VB/StatementTests.cs index 98a76bc13..9035531c4 100644 --- a/Tests/VB/StatementTests.cs +++ b/Tests/VB/StatementTests.cs @@ -161,10 +161,7 @@ Private Sub TestMethod() Dim b As String b = New String(""test"") End Sub -End Class - -1 source compilation errors: -CS1503: Argument 1: cannot convert from 'string' to 'char*'"); +End Class"); } [Fact] @@ -180,10 +177,7 @@ void TestMethod() Private Sub TestMethod() Dim b As String = New String(""test"") End Sub -End Class - -1 source compilation errors: -CS1503: Argument 1: cannot convert from 'string' to 'char*'"); +End Class"); } [Fact] @@ -199,10 +193,7 @@ void TestMethod() Private Sub TestMethod() Dim b = New String(""test"") End Sub -End Class - -1 source compilation errors: -CS1503: Argument 1: cannot convert from 'string' to 'char*'"); +End Class"); } [Fact] diff --git a/Vsix/Vsix.csproj b/Vsix/Vsix.csproj index bad7ddc59..04b584921 100644 --- a/Vsix/Vsix.csproj +++ b/Vsix/Vsix.csproj @@ -51,7 +51,7 @@ - + compile; build; native; contentfiles; analyzers; buildtransitive @@ -70,6 +70,9 @@ 4.8.6 + + 10.0.0 + diff --git a/Web/ClientApp/package.json b/Web/ClientApp/package.json index 4f14e9c9f..e91845d57 100644 --- a/Web/ClientApp/package.json +++ b/Web/ClientApp/package.json @@ -1,64 +1,64 @@ -{ - "name": "codeconverter", - "version": "0.1.0", - "private": true, - "eslintConfig": { - "extends": "react-app" - }, - "scripts": { - "prestart": "node aspnetcore-https && node aspnetcore-react", - "start": "rimraf ./build && react-scripts start", - "build": "react-scripts build", - "test": "cross-env CI=true react-scripts test --env=jsdom", - "eject": "react-scripts eject", - "lint": "eslint ./src/" - }, - "browserslist": { - "production": [ - ">0.2%", - "not dead", - "not op_mini all" - ], - "development": [ - "last 1 chrome version", - "last 1 firefox version", - "last 1 safari version" - ] - }, - "babel": { - "presets": [ - [ - "@babel/preset-react", - { - "runtime": "automatic" - } - ] - ] - }, - "dependencies": { - "@monaco-editor/react": "^4.6.0", - "axios": "^1.12.0", - "bootstrap": "^5.3.3", - "monaco-editor": "^0.52.0", - "prop-types": "^15.8.1", - "react": "^18.3.1", - "react-dom": "^18.3.1", - "react-router-bootstrap": "^0.26.3", - "react-router-dom": "^6.26.2", - "reactstrap": "^9.2.3" - }, - "devDependencies": { - "@types/jest": "^29.5.13", - "@types/react": "^18.3.10", - "@types/react-dom": "^18.3.0", - "ajv": "^8.17.1", - "cross-env": "^7.0.3", - "eslint-config-react-app": "^7.0.1", - "http-proxy-middleware": "^3.0.2", - "jquery": "^3.7.1", - "popper.js": "^1.16.1", - "react-scripts": "^5.0.1", - "rimraf": "^6.0.1", - "typescript": "^4.9.5" - } -} +{ + "name": "codeconverter", + "version": "0.1.0", + "private": true, + "eslintConfig": { + "extends": "react-app" + }, + "scripts": { + "prestart": "node aspnetcore-https && node aspnetcore-react", + "start": "rimraf ./build && react-scripts start", + "build": "react-scripts build", + "test": "cross-env CI=true react-scripts test --env=jsdom", + "eject": "react-scripts eject", + "lint": "eslint ./src/" + }, + "browserslist": { + "production": [ + ">0.2%", + "not dead", + "not op_mini all" + ], + "development": [ + "last 1 chrome version", + "last 1 firefox version", + "last 1 safari version" + ] + }, + "babel": { + "presets": [ + [ + "@babel/preset-react", + { + "runtime": "automatic" + } + ] + ] + }, + "dependencies": { + "@monaco-editor/react": "^4.6.0", + "axios": "^1.12.0", + "bootstrap": "^5.3.3", + "monaco-editor": "^0.52.0", + "prop-types": "^15.8.1", + "react": "^18.3.1", + "react-dom": "^18.3.1", + "react-router-bootstrap": "^0.26.3", + "react-router-dom": "^6.26.2", + "reactstrap": "^9.2.3" + }, + "devDependencies": { + "@types/jest": "^29.5.13", + "@types/react": "^18.3.10", + "@types/react-dom": "^18.3.0", + "ajv": "^8.17.1", + "cross-env": "^7.0.3", + "eslint-config-react-app": "^7.0.1", + "http-proxy-middleware": "^3.0.2", + "jquery": "^3.7.1", + "popper.js": "^1.16.1", + "react-scripts": "^5.0.1", + "rimraf": "^6.0.1", + "typescript": "^4.9.5" + } +} diff --git a/Web/Program.cs b/Web/Program.cs index 07e1e2b46..367b919a8 100644 --- a/Web/Program.cs +++ b/Web/Program.cs @@ -1,6 +1,4 @@ -using ICSharpCode.CodeConverter.Util; -using ICSharpCode.CodeConverter.Web; -using Microsoft.OpenApi.Models; +using Microsoft.OpenApi.Models; var builder = WebApplication.CreateBuilder(args); @@ -34,14 +32,6 @@ app.UseRouting(); app.UseCors(localOrigins); -app.MapPost("/api/convert", async (ConvertRequest todo) => await WebConverter.ConvertAsync(todo)) - .RequireCors(localOrigins) - .Produces(); - -app.MapGet("/api/version", () => CodeConverterVersion.GetVersion()) - .RequireCors(localOrigins) - .Produces(); - app.MapFallbackToFile("index.html"); app.Run(); \ No newline at end of file diff --git a/Web/Web.csproj b/Web/Web.csproj index 428c8acfb..5161f5880 100644 --- a/Web/Web.csproj +++ b/Web/Web.csproj @@ -15,18 +15,11 @@ 10.0 - - - - - - - - +