46 lines
1.3 KiB
C#
46 lines
1.3 KiB
C#
namespace ProxyInterfaceSourceGeneratorTests.Source.Disposable
|
|
{
|
|
public class Parent : IDisposable, IUpdate<string>
|
|
{
|
|
private bool disposedValue;
|
|
|
|
public event EventHandler<string>? Update;
|
|
|
|
public string Name => nameof(Parent);
|
|
|
|
public void Dispose()
|
|
{
|
|
// Do not change this code. Put cleanup code in 'Dispose(bool disposing)' method
|
|
Dispose(disposing: true);
|
|
GC.SuppressFinalize(this);
|
|
}
|
|
|
|
public bool Empty()
|
|
{
|
|
return false;
|
|
}
|
|
|
|
protected virtual void Dispose(bool disposing)
|
|
{
|
|
if (!disposedValue)
|
|
{
|
|
if (disposing)
|
|
{
|
|
// TODO: dispose managed state (managed objects)
|
|
}
|
|
|
|
// TODO: free unmanaged resources (unmanaged objects) and override finalizer
|
|
// TODO: set large fields to null
|
|
disposedValue = true;
|
|
}
|
|
}
|
|
|
|
// // TODO: override finalizer only if 'Dispose(bool disposing)' has code to free unmanaged resources
|
|
// ~TrashCan()
|
|
// {
|
|
// // Do not change this code. Put cleanup code in 'Dispose(bool disposing)' method
|
|
// Dispose(disposing: false);
|
|
// }
|
|
}
|
|
}
|