Forge
csharpdeeb25a2
1#nullable enable
2using Avalonia.Threading;
3using CascadeIDE.Cockpit.DataBus;
4using CascadeIDE.Contracts;
5
6namespace CascadeIDE.Features.HybridIndex.Application;
7
8/// <summary>
9/// Подписка HIS на <see cref="HybridIndexStateChanged"/> в шине IDE: маршалинг на UI-поток
10/// (<see cref="DispatcherPriority.Background"/>) перед обновлением снимка состояния.
11/// </summary>
12[DataBusSubscriber("hybrid-index-his")]
13[UiThreadMarshal("bus → IUiScheduler.Post Background")]
14public static class HybridIndexHisStateBusSubscription
15{
16 public static IDisposable Subscribe(
17 IDataBus dataBus,
18 IUiScheduler ui,
19 Action<HybridIndexStateChanged> apply)
20 => dataBus.Subscribe<HybridIndexStateChanged>(evt =>
21 ui.Post(() => apply(evt), DispatcherPriority.Background));
22}
23
View only · write via MCP/CIDE