4e85a6cccc
* add base revit 26 projects * fix up cef replacement * fix up revit 2026 events * add revit events * fixes for revit 26 * use right version of DI for Revit26 * add Revit26 to local * fmt * use visual studio to fix slns * Add revit to installer constants * move webview stuff to 2026 specific area to avoid build issues * update locks * Revit 2026 wants to invoke scripts with RevitTask. Abstract RevitTask * fmt * fix project copying * use 3.2 SDK * fix build * Revit 2025 is now CEF vulnerable * add SendProgress to not overload revit context * update Revit 26 lock files * update locks --------- Co-authored-by: Oğuzhan Koral <45078678+oguzhankoral@users.noreply.github.com>
46 lines
1.8 KiB
C#
46 lines
1.8 KiB
C#
using Speckle.Connectors.DUI.Bindings;
|
|
|
|
namespace Speckle.Connectors.DUI.Bridge;
|
|
|
|
/// <summary>
|
|
/// Describes a bridge - a wrapper class around a specific browser host. Not needed right now,
|
|
/// but if in the future we will have other bridge classes (e.g, ones that wrap around other browsers),
|
|
/// it just might be useful.
|
|
/// </summary>
|
|
public interface IBrowserBridge
|
|
{
|
|
// POC: documnetation comments
|
|
string FrontendBoundName { get; }
|
|
|
|
void AssociateWithBinding(IBinding binding);
|
|
|
|
/// <summary>
|
|
/// This method is called by the Frontend bridge to understand what it can actually call. It should return the method names of the bindings that this bridge wraps around.
|
|
/// </summary>
|
|
/// <returns></returns>
|
|
public string[] GetBindingsMethodNames();
|
|
|
|
/// <summary>
|
|
/// This method is called by the Frontend bridge when invoking any of the wrapped binding's methods.
|
|
/// </summary>
|
|
/// <param name="methodName"></param>
|
|
/// <param name="requestId"></param>
|
|
/// <param name="args"></param>
|
|
/// <returns></returns>
|
|
public void RunMethod(string methodName, string requestId, string args);
|
|
|
|
/// <param name="eventName"></param>
|
|
/// <exception cref="InvalidOperationException">Bridge was not initialized with a binding</exception>
|
|
public Task Send(string eventName, CancellationToken cancellationToken = default);
|
|
|
|
/// <inheritdoc cref="Send(string, CancellationToken)"/>
|
|
/// <param name="data">data to store</param>
|
|
/// <typeparam name="T"></typeparam>
|
|
/// <exception cref="InvalidOperationException">Bridge was not initialized with a binding</exception>
|
|
public Task Send<T>(string eventName, T data, CancellationToken cancellationToken = default)
|
|
where T : class;
|
|
|
|
public void SendProgress<T>(string eventName, T data)
|
|
where T : class;
|
|
}
|