BililiveRecorder/BililiveRecorder.Web/FakeRecorderForWeb.cs

69 lines
2.5 KiB
C#
Raw Normal View History

2021-05-30 19:16:20 +08:00
using System;
using System.Collections.ObjectModel;
using System.ComponentModel;
using BililiveRecorder.Core;
2022-04-03 19:50:51 +08:00
using BililiveRecorder.Core.Config.V3;
2021-05-30 19:16:20 +08:00
using BililiveRecorder.Core.Event;
namespace BililiveRecorder.Web
{
internal class FakeRecorderForWeb : IRecorder
{
private bool disposedValue;
2022-04-03 19:50:51 +08:00
public ConfigV3 Config { get; } = new ConfigV3();
2021-05-30 19:16:20 +08:00
public ReadOnlyObservableCollection<IRoom> Rooms { get; } = new ReadOnlyObservableCollection<IRoom>(new ObservableCollection<IRoom>());
2022-04-03 13:34:55 +08:00
#pragma warning disable CS0067
2021-05-30 19:16:20 +08:00
public event EventHandler<AggregatedRoomEventArgs<RecordSessionStartedEventArgs>>? RecordSessionStarted;
public event EventHandler<AggregatedRoomEventArgs<RecordSessionEndedEventArgs>>? RecordSessionEnded;
public event EventHandler<AggregatedRoomEventArgs<RecordFileOpeningEventArgs>>? RecordFileOpening;
public event EventHandler<AggregatedRoomEventArgs<RecordFileClosedEventArgs>>? RecordFileClosed;
2022-04-09 16:43:05 +08:00
public event EventHandler<AggregatedRoomEventArgs<IOStatsEventArgs>>? IOStats;
2021-05-30 19:16:20 +08:00
public event EventHandler<AggregatedRoomEventArgs<RecordingStatsEventArgs>>? RecordingStats;
public event PropertyChangedEventHandler? PropertyChanged;
public event EventHandler<IRoom>? StreamStarted;
2022-04-03 13:34:55 +08:00
#pragma warning restore CS0067
2021-05-30 19:16:20 +08:00
public IRoom AddRoom(int roomid) => null!;
public IRoom AddRoom(int roomid, bool enabled) => null!;
public void RemoveRoom(IRoom room)
{ }
public void SaveConfig()
{ }
protected virtual void Dispose(bool disposing)
{
if (!this.disposedValue)
{
if (disposing)
{
// TODO: dispose managed state (managed objects)
}
// TODO: free unmanaged resources (unmanaged objects) and override finalizer
// TODO: set large fields to null
this.disposedValue = true;
}
}
// // TODO: override finalizer only if 'Dispose(bool disposing)' has code to free unmanaged resources
// ~FakeRecorderForWeb()
// {
// // 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
this.Dispose(disposing: true);
GC.SuppressFinalize(this);
}
}
}