Added Updated-events

This commit is contained in:
DarthAffe committed 2021-05-21 21:02:13 +02:00
1 parent 1702415aa0
commit e6202d88b5
3 files changed
+47 -2

No files matched your search

+14 -1
View File
@@ -3,6 +3,7 @@ using System.Collections.Generic;
using System.Linq;
using System.Runtime.InteropServices;
using System.Threading;
using ScreenCapture.Events;
using SharpGen.Runtime;
using Vortice.Direct3D;
using Vortice.Direct3D11;
@@ -15,7 +16,7 @@ using Usage = Vortice.Direct3D11.Usage;
namespace ScreenCapture
{
// ReSharper disable once InconsistentNaming
public class DX11ScreenCapture : IScreenCapture
public sealed class DX11ScreenCapture : IScreenCapture
{
#region Constants
@@ -51,6 +52,12 @@ namespace ScreenCapture
#endregion
#region Events
public event EventHandler<ScreenCaptureUpdatedEventArgs>? Updated;
#endregion
#region Constructors
public DX11ScreenCapture(IDXGIFactory1 factory, Display display)
@@ -120,6 +127,12 @@ namespace ScreenCapture
}
catch { /**/ }
try
{
Updated?.Invoke(this, new ScreenCaptureUpdatedEventArgs(result));
}
catch { /**/ }
return result;
}
}