Skip to content

Commit b19352d

Browse files
committed
Upgraded to Net 10.0
1 parent be559f2 commit b19352d

9 files changed

Lines changed: 600 additions & 607 deletions

Src/System.DisposableObject Solution/System.DisposableObject Solution.sln renamed to Src/System.DisposableObject Solution.sln

Lines changed: 31 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,31 @@
1-
2-
Microsoft Visual Studio Solution File, Format Version 12.00
3-
# Visual Studio Version 16
4-
VisualStudioVersion = 16.0.30711.63
5-
MinimumVisualStudioVersion = 10.0.40219.1
6-
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "System.DisposableObject", "System.DisposableObject\System.DisposableObject.csproj", "{4CDC94D6-3CA2-44F6-BA7C-9D9A3D3BA437}"
7-
EndProject
8-
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "System.DisposableObject.Example", "System.DisposableObject.Example\System.DisposableObject.Example.csproj", "{6E3A1E1B-C1F0-4664-9C43-5C68CBC78994}"
9-
EndProject
10-
Global
11-
GlobalSection(SolutionConfigurationPlatforms) = preSolution
12-
Debug|Any CPU = Debug|Any CPU
13-
Release|Any CPU = Release|Any CPU
14-
EndGlobalSection
15-
GlobalSection(ProjectConfigurationPlatforms) = postSolution
16-
{4CDC94D6-3CA2-44F6-BA7C-9D9A3D3BA437}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
17-
{4CDC94D6-3CA2-44F6-BA7C-9D9A3D3BA437}.Debug|Any CPU.Build.0 = Debug|Any CPU
18-
{4CDC94D6-3CA2-44F6-BA7C-9D9A3D3BA437}.Release|Any CPU.ActiveCfg = Release|Any CPU
19-
{4CDC94D6-3CA2-44F6-BA7C-9D9A3D3BA437}.Release|Any CPU.Build.0 = Release|Any CPU
20-
{6E3A1E1B-C1F0-4664-9C43-5C68CBC78994}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
21-
{6E3A1E1B-C1F0-4664-9C43-5C68CBC78994}.Debug|Any CPU.Build.0 = Debug|Any CPU
22-
{6E3A1E1B-C1F0-4664-9C43-5C68CBC78994}.Release|Any CPU.ActiveCfg = Release|Any CPU
23-
{6E3A1E1B-C1F0-4664-9C43-5C68CBC78994}.Release|Any CPU.Build.0 = Release|Any CPU
24-
EndGlobalSection
25-
GlobalSection(SolutionProperties) = preSolution
26-
HideSolutionNode = FALSE
27-
EndGlobalSection
28-
GlobalSection(ExtensibilityGlobals) = postSolution
29-
SolutionGuid = {85AB7396-4B35-436C-BD17-F4F3432A3E5F}
30-
EndGlobalSection
31-
EndGlobal
1+
2+
Microsoft Visual Studio Solution File, Format Version 12.00
3+
# Visual Studio Version 16
4+
VisualStudioVersion = 16.0.30711.63
5+
MinimumVisualStudioVersion = 10.0.40219.1
6+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "System.DisposableObject", "System.DisposableObject\System.DisposableObject.csproj", "{4CDC94D6-3CA2-44F6-BA7C-9D9A3D3BA437}"
7+
EndProject
8+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "System.DisposableObject.Example", "System.DisposableObject.Example\System.DisposableObject.Example.csproj", "{6E3A1E1B-C1F0-4664-9C43-5C68CBC78994}"
9+
EndProject
10+
Global
11+
GlobalSection(SolutionConfigurationPlatforms) = preSolution
12+
Debug|Any CPU = Debug|Any CPU
13+
Release|Any CPU = Release|Any CPU
14+
EndGlobalSection
15+
GlobalSection(ProjectConfigurationPlatforms) = postSolution
16+
{4CDC94D6-3CA2-44F6-BA7C-9D9A3D3BA437}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
17+
{4CDC94D6-3CA2-44F6-BA7C-9D9A3D3BA437}.Debug|Any CPU.Build.0 = Debug|Any CPU
18+
{4CDC94D6-3CA2-44F6-BA7C-9D9A3D3BA437}.Release|Any CPU.ActiveCfg = Release|Any CPU
19+
{4CDC94D6-3CA2-44F6-BA7C-9D9A3D3BA437}.Release|Any CPU.Build.0 = Release|Any CPU
20+
{6E3A1E1B-C1F0-4664-9C43-5C68CBC78994}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
21+
{6E3A1E1B-C1F0-4664-9C43-5C68CBC78994}.Debug|Any CPU.Build.0 = Debug|Any CPU
22+
{6E3A1E1B-C1F0-4664-9C43-5C68CBC78994}.Release|Any CPU.ActiveCfg = Release|Any CPU
23+
{6E3A1E1B-C1F0-4664-9C43-5C68CBC78994}.Release|Any CPU.Build.0 = Release|Any CPU
24+
EndGlobalSection
25+
GlobalSection(SolutionProperties) = preSolution
26+
HideSolutionNode = FALSE
27+
EndGlobalSection
28+
GlobalSection(ExtensibilityGlobals) = postSolution
29+
SolutionGuid = {85AB7396-4B35-436C-BD17-F4F3432A3E5F}
30+
EndGlobalSection
31+
EndGlobal

Src/System.DisposableObject Solution/System.DisposableObject.Example/Program.cs renamed to Src/System.DisposableObject.Example/Program.cs

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,22 @@
1-
namespace Sample
2-
{
3-
class Program
4-
{
5-
static void Main(string[] args)
6-
{
7-
using (SomeObject obj1 = new())
8-
{
9-
//
10-
// obj will be disposed and the dispose
11-
// methods will be called.
12-
}
13-
14-
using (SomeAsyncObject obj2 = new())
15-
{
16-
//
17-
// obj will be disposed and the dispose
18-
// methods will be called.
19-
}
20-
}
21-
}
22-
}
1+
namespace Sample
2+
{
3+
class Program
4+
{
5+
static void Main(string[] args)
6+
{
7+
using (SomeObject obj1 = new())
8+
{
9+
//
10+
// obj will be disposed and the dispose
11+
// methods will be called.
12+
}
13+
14+
using (SomeAsyncObject obj2 = new())
15+
{
16+
//
17+
// obj will be disposed and the dispose
18+
// methods will be called.
19+
}
20+
}
21+
}
22+
}

Src/System.DisposableObject Solution/System.DisposableObject.Example/SomeAsyncObject.cs renamed to Src/System.DisposableObject.Example/SomeAsyncObject.cs

File renamed without changes.

Src/System.DisposableObject Solution/System.DisposableObject.Example/SomeObject.cs renamed to Src/System.DisposableObject.Example/SomeObject.cs

File renamed without changes.

Src/System.DisposableObject Solution/System.DisposableObject.Example/System.DisposableObject.Example.csproj renamed to Src/System.DisposableObject.Example/System.DisposableObject.Example.csproj

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
1-
<Project Sdk="Microsoft.NET.Sdk">
2-
3-
<PropertyGroup>
4-
<OutputType>Exe</OutputType>
5-
<TargetFramework>net9.0</TargetFramework>
6-
<Version>9.0.0</Version>
7-
<FileVersion>9.0.0</FileVersion>
8-
<AssemblyVersion>9.0.0</AssemblyVersion>
9-
</PropertyGroup>
10-
11-
<ItemGroup>
12-
<ProjectReference Include="..\System.DisposableObject\System.DisposableObject.csproj" />
13-
</ItemGroup>
14-
15-
</Project>
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
3+
<PropertyGroup>
4+
<OutputType>Exe</OutputType>
5+
<TargetFramework>net10.0</TargetFramework>
6+
<Version>10.0.0</Version>
7+
<FileVersion>10.0.0</FileVersion>
8+
<AssemblyVersion>10.0.0</AssemblyVersion>
9+
</PropertyGroup>
10+
11+
<ItemGroup>
12+
<ProjectReference Include="..\System.DisposableObject\System.DisposableObject.csproj" />
13+
</ItemGroup>
14+
15+
</Project>

Src/System.DisposableObject Solution/System.DisposableObject/AsyncDisposableObject.cs renamed to Src/System.DisposableObject/AsyncDisposableObject.cs

Lines changed: 92 additions & 92 deletions
Original file line numberDiff line numberDiff line change
@@ -1,93 +1,93 @@
1-
//
2-
// Copyright(C) 2017-2021, Daniel M. Porrey. All rights reserved.
3-
//
4-
// This program is free software: you can redistribute it and/or modify
5-
// it under the terms of the GNU Lesser General Public License as published
6-
// by the Free Software Foundation, either version 3 of the License, or
7-
// (at your option) any later version.
8-
//
9-
// This program is distributed in the hope that it will be useful,
10-
// but WITHOUT ANY WARRANTY; without even the implied warranty of
11-
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12-
// GNU Lesser General Public License for more details.
13-
//
14-
// You should have received a copy of the GNU Lesser General Public License
15-
// along with this program. If not, see http://www.gnu.org/licenses/.
16-
//
17-
using System.Diagnostics;
18-
using System.Threading.Tasks;
19-
20-
namespace System
21-
{
22-
/// <summary>
23-
/// This class provides base functionality for implementing
24-
/// <see cref="IAsyncDisposable"/>. Since we are dealing with
25-
/// database resources, disposing of objects is important. Any
26-
/// class that inherits from this class simply needs to override
27-
/// OnDisposeManagedObjects and/or OnDisposeUnmanagedObjects.
28-
/// </summary>
29-
public abstract class AsyncDisposableObject : DisposableObject, IAsyncDisposable
30-
{
31-
/// <summary>
32-
/// Default constructor for <see cref="AsyncDisposableObject"/>.
33-
/// </summary>
34-
public AsyncDisposableObject()
35-
{
36-
//
37-
// Set this to True for debugging.
38-
//
39-
this.AssertWhenNotDisposed = false;
40-
}
41-
42-
/// <summary>
43-
/// Default destructor for <see cref="AsyncDisposableObject"/>.
44-
/// </summary>
45-
~AsyncDisposableObject()
46-
{
47-
//
48-
// Write a trace (to the debugger) showing this method was called (it will only
49-
// get called if this object is not Disposed).
50-
//
51-
Trace.TraceWarning("~BaseObject called on {0}", this.OnGetClassName());
52-
53-
//
54-
// Give the parent object a chance to respond, if not then this
55-
// class will assert.
56-
//
57-
if (this.AssertWhenNotDisposed)
58-
{
59-
if (!this.OnNotDisposedProperly())
60-
{
61-
//
62-
// Assert if this object is destroyed without being disposed. Even though
63-
// dispose is called here, it is more ideal that it be called by the user
64-
// of the object. This assert will help catch this instance.
65-
//
66-
Trace.Assert(this.IsDisposed, this.OnGetClassName() + " was not disposed properly.");
67-
}
68-
else
69-
{
70-
Trace.TraceWarning("{0} was not disposed properly.", this.OnGetClassName());
71-
}
72-
}
73-
74-
//
75-
// This destructor is only called by garbage collection. Because of this, this object
76-
// can no longer access managed objects. Only unmanaged objects will be cleaned up
77-
// here.
78-
//
79-
this.Dispose(false);
80-
}
81-
82-
/// <summary>
83-
/// Performs application-defined tasks associated with freeing, releasing, or resetting
84-
/// unmanaged resources asynchronously.
85-
/// </summary>
86-
/// <returns></returns>
87-
public virtual ValueTask DisposeAsync()
88-
{
89-
this.Dispose();
90-
return ValueTask.CompletedTask;
91-
}
92-
}
1+
//
2+
// Copyright(C) 2017-2021, Daniel M. Porrey. All rights reserved.
3+
//
4+
// This program is free software: you can redistribute it and/or modify
5+
// it under the terms of the GNU Lesser General Public License as published
6+
// by the Free Software Foundation, either version 3 of the License, or
7+
// (at your option) any later version.
8+
//
9+
// This program is distributed in the hope that it will be useful,
10+
// but WITHOUT ANY WARRANTY; without even the implied warranty of
11+
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12+
// GNU Lesser General Public License for more details.
13+
//
14+
// You should have received a copy of the GNU Lesser General Public License
15+
// along with this program. If not, see http://www.gnu.org/licenses/.
16+
//
17+
using System.Diagnostics;
18+
using System.Threading.Tasks;
19+
20+
namespace System
21+
{
22+
/// <summary>
23+
/// This class provides base functionality for implementing
24+
/// <see cref="IAsyncDisposable"/>. Since we are dealing with
25+
/// database resources, disposing of objects is important. Any
26+
/// class that inherits from this class simply needs to override
27+
/// OnDisposeManagedObjects and/or OnDisposeUnmanagedObjects.
28+
/// </summary>
29+
public abstract class AsyncDisposableObject : DisposableObject, IAsyncDisposable
30+
{
31+
/// <summary>
32+
/// Default constructor for <see cref="AsyncDisposableObject"/>.
33+
/// </summary>
34+
public AsyncDisposableObject()
35+
{
36+
//
37+
// Set this to True for debugging.
38+
//
39+
this.AssertWhenNotDisposed = false;
40+
}
41+
42+
/// <summary>
43+
/// Default destructor for <see cref="AsyncDisposableObject"/>.
44+
/// </summary>
45+
~AsyncDisposableObject()
46+
{
47+
//
48+
// Write a trace (to the debugger) showing this method was called (it will only
49+
// get called if this object is not Disposed).
50+
//
51+
Trace.TraceWarning("~BaseObject called on {0}", this.OnGetClassName());
52+
53+
//
54+
// Give the parent object a chance to respond, if not then this
55+
// class will assert.
56+
//
57+
if (this.AssertWhenNotDisposed)
58+
{
59+
if (!this.OnNotDisposedProperly())
60+
{
61+
//
62+
// Assert if this object is destroyed without being disposed. Even though
63+
// dispose is called here, it is more ideal that it be called by the user
64+
// of the object. This assert will help catch this instance.
65+
//
66+
Trace.Assert(this.IsDisposed, this.OnGetClassName() + " was not disposed properly.");
67+
}
68+
else
69+
{
70+
Trace.TraceWarning("{0} was not disposed properly.", this.OnGetClassName());
71+
}
72+
}
73+
74+
//
75+
// This destructor is only called by garbage collection. Because of this, this object
76+
// can no longer access managed objects. Only unmanaged objects will be cleaned up
77+
// here.
78+
//
79+
this.Dispose(false);
80+
}
81+
82+
/// <summary>
83+
/// Performs application-defined tasks associated with freeing, releasing, or resetting
84+
/// unmanaged resources asynchronously.
85+
/// </summary>
86+
/// <returns></returns>
87+
public virtual ValueTask DisposeAsync()
88+
{
89+
this.Dispose();
90+
return ValueTask.CompletedTask;
91+
}
92+
}
9393
}

0 commit comments

Comments
 (0)