mirror of
https://github.com/BililiveRecorder/BililiveRecorder.git
synced 2024-12-26 12:15:42 +08:00
51 lines
1.3 KiB
C#
51 lines
1.3 KiB
C#
using System;
|
|
using BililiveRecorder.Core;
|
|
|
|
namespace BililiveRecorder.WPF.Models
|
|
{
|
|
internal class RootModel : IDisposable
|
|
{
|
|
private bool disposedValue;
|
|
|
|
public LogModel Logs { get; } = new LogModel();
|
|
|
|
public IRecorder Recorder { get; internal set; }
|
|
|
|
public RootModel()
|
|
{
|
|
|
|
}
|
|
|
|
protected virtual void Dispose(bool disposing)
|
|
{
|
|
if (!disposedValue)
|
|
{
|
|
if (disposing)
|
|
{
|
|
// dispose managed state (managed objects)
|
|
Recorder?.Dispose();
|
|
Logs.Dispose();
|
|
}
|
|
|
|
// free unmanaged resources (unmanaged objects) and override finalizer
|
|
// set large fields to null
|
|
disposedValue = true;
|
|
}
|
|
}
|
|
|
|
// override finalizer only if 'Dispose(bool disposing)' has code to free unmanaged resources
|
|
// ~RootModel()
|
|
// {
|
|
// // Do not change this code. Put cleanup code in 'Dispose(bool disposing)' method
|
|
// Dispose(disposing: false);
|
|
// }
|
|
|
|
public void Dispose()
|
|
{
|
|
// Do not change this code. Put cleanup code in 'Dispose(bool disposing)' method
|
|
Dispose(disposing: true);
|
|
GC.SuppressFinalize(this);
|
|
}
|
|
}
|
|
}
|