Upgrade to .NET 8 and latest C# #293
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request includes several changes aimed at simplifying the codebase and improving consistency by replacing
new[] { ... }with[...]and refactoring class constructors. The most important changes include modifications to various sample methods, class constructors, and internal structures.Simplification and consistency improvements:
Sharprompt.Example/Program.cs: Replacednew[] { ... }with[...]in multiple sample methods, such asRunInputSample,RunPasswordSample,RunSelectSample,RunMultiSelectSample, andRunSelectEnumSample. [1] [2] [3]Sharprompt.Tests/PropertyMetadataTests.cs: Changednew[] { ... }to[...]inGetSelectItemsandSelectItemsproperties.Class constructor refactoring:
Sharprompt/Forms/FormRenderer.cs: Modified the class constructor to use inline initialization for_offscreenBuffer.Sharprompt/Internal/Optional.cs: RefactoredOptional<T>to use a primary constructor and simplified property initialization.Sharprompt/Symbol.cs: UpdatedSymbolclass to use primary constructor and removed redundant fields.Internal structure updates:
Sharprompt/Internal/OffscreenBuffer.cs: Replacednew List<TextInfo>()with[]in_outputBufferinitialization and related methods. [1] [2] [3]Sharprompt/Internal/Paginator.cs: Changed_filteredItemsinitialization fromArray.Empty<T>()to[].Project configuration update:
Sharprompt/Sharprompt.csproj: Updated the project to target only .NET 8.0 instead of multiple frameworks.