Skip to content

Commit 5b29a81

Browse files
Merge branch 'dotnet8' into main
2 parents 88700d5 + 5e1ad95 commit 5b29a81

70 files changed

Lines changed: 289 additions & 213 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1_CS/Arrays/ArrayPoolSample/ArrayPoolSample.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
<PropertyGroup>
44
<OutputType>Exe</OutputType>
5-
<TargetFramework>net7.0</TargetFramework>
5+
<TargetFramework>net8.0</TargetFramework>
66
<Nullable>enable</Nullable>
77
<ImplicitUsings>enable</ImplicitUsings>
88
</PropertyGroup>

1_CS/Arrays/BitArraySample/BitArrayExtensions.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
public static class BitArrayExtensions
1+
namespace BitArraySample;
2+
3+
public static class BitArrayExtensions
24
{
35
public static string FormatString(this BitArray bits)
46
{
@@ -8,7 +10,7 @@ public static string FormatString(this BitArray bits)
810
sb.Append(bits[i] ? 1 : 0);
911
if (i != 0 && i % 4 == 0)
1012
{
11-
sb.Append("_");
13+
sb.Append('_');
1214
}
1315
}
1416

1_CS/Arrays/BitArraySample/BitArraySample.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
<PropertyGroup>
44
<OutputType>Exe</OutputType>
5-
<TargetFramework>net7.0</TargetFramework>
5+
<TargetFramework>net8.0</TargetFramework>
66
<Nullable>enable</Nullable>
77
<ImplicitUsings>enable</ImplicitUsings>
88
</PropertyGroup>
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
global using System.Collections;
2+
global using System.Text;
3+
4+
global using BitArraySample;

1_CS/Arrays/BitArraySample/Program.cs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
1-
global using System.Collections;
2-
global using System.Text;
3-
4-
BitArray bits1 = new(9);
1+
BitArray bits1 = new(9);
52
bits1.SetAll(true);
63
bits1.Set(1, false);
74
bits1[5] = false;

1_CS/Arrays/BitVectorSample/BinaryExtensions.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
public static class BinaryExtensions
1+
namespace BitVectorSample;
2+
3+
public static class BinaryExtensions
24
{
35
public static string AddSeparators(this string number) =>
46
number.Length <= 4 ? number :

1_CS/Arrays/BitVectorSample/BitVectorSample.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
<PropertyGroup>
44
<OutputType>Exe</OutputType>
5-
<TargetFramework>net7.0</TargetFramework>
5+
<TargetFramework>net8.0</TargetFramework>
66
<Nullable>enable</Nullable>
77
<ImplicitUsings>enable</ImplicitUsings>
88
</PropertyGroup>
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
global using System.Collections.Specialized;
2+
3+
global using BitVectorSample;

1_CS/Arrays/BitVectorSample/Program.cs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
using System.Collections.Specialized;
2-
3-
// create a mask using the CreateMask method
1+
// create a mask using the CreateMask method
42
BitVector32 bits1 = new();
53
int bit1 = BitVector32.CreateMask();
64
int bit2 = BitVector32.CreateMask(bit1);
@@ -21,7 +19,7 @@
2119

2220
int received = 0x_79ab_cdef;
2321

24-
BitVector32 bits2 = new BitVector32(received);
22+
BitVector32 bits2 = new(received);
2523
Console.WriteLine(bits2);
2624

2725
// sections: FF EEE DDD CCCC BBBBBBBB
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
// This file is used by Code Analysis to maintain SuppressMessage
2+
// attributes that are applied to this project.
3+
// Project-level suppressions either have no target or are given
4+
// a specific target and scoped to a namespace, type, member, etc.
5+
6+
using System.Diagnostics.CodeAnalysis;
7+
8+
[assembly: SuppressMessage("Style", "IDE0056:Use index operator", Justification = "Sample showing how this can be simplified")]

0 commit comments

Comments
 (0)