Files
cefsharp/CefSharp/DevTools/IEventProxy.cs
T
Alex Maitland cf00a45833 DevTools Client - Simplify Strongly Typed Event handling (#3777)
* DevTools Client - Simplify Strongly Typed Event handling

Now it's only possible to register one System.Type per event.

- Remove RegisterEventHandler
- Add AddEventHandler and RemoveEventHandler
- Change constraint from DevToolsDomainEventArgsBase to EventArgs

https://github.com/cefsharp/CefSharp/issues/3666

* Changes were based on https://github.com/CefNet/CefNet.DevTools.Protocol

Add links to original source files

* Reset stream position

* AddEventHandler - Use GetOrAdd for Thread safety

* AddEventHandler - Fix double event handler registration for first call

* RemoveEventHandler - Remove IEventProxy when handler null
2021-09-03 20:10:42 +10:00

26 lines
805 B
C#

// Copyright © 2021 The CefSharp Authors. All rights reserved.
//
// Use of this source code is governed by a BSD-style license that can be found in the LICENSE file.
// Originally Based on https://github.com/CefNet/CefNet.DevTools.Protocol/blob/0a124720474a469b5cef03839418f5e1debaf2f0/CefNet.DevTools.Protocol/IEventProxy.cs
using System;
using System.IO;
namespace CefSharp.DevTools
{
/// <summary>
/// Event Proxy
/// </summary>
internal interface IEventProxy : IDisposable
{
/// <summary>
/// Raise Event
/// </summary>
/// <param name="sender">sender</param>
/// <param name="eventName">event name</param>
/// <param name="stream">json Stream</param>
void Raise(object sender, string eventName, Stream stream);
}
}