@@ -20,13 +20,13 @@ public abstract partial class Renderer : IDisposable
20
20
private readonly IServiceProvider _serviceProvider ;
21
21
private readonly Dictionary < int , ComponentState > _componentStateById = new Dictionary < int , ComponentState > ( ) ;
22
22
private readonly RenderBatchBuilder _batchBuilder = new RenderBatchBuilder ( ) ;
23
- private readonly Dictionary < int , EventCallback > _eventBindings = new Dictionary < int , EventCallback > ( ) ;
24
- private readonly Dictionary < int , int > _eventHandlerIdReplacements = new Dictionary < int , int > ( ) ;
23
+ private readonly Dictionary < ulong , EventCallback > _eventBindings = new Dictionary < ulong , EventCallback > ( ) ;
24
+ private readonly Dictionary < ulong , ulong > _eventHandlerIdReplacements = new Dictionary < ulong , ulong > ( ) ;
25
25
private readonly ILogger < Renderer > _logger ;
26
26
27
27
private int _nextComponentId = 0 ; // TODO: change to 'long' when Mono .NET->JS interop supports it
28
28
private bool _isBatchInProgress ;
29
- private int _lastEventHandlerId = 0 ;
29
+ private ulong _lastEventHandlerId ;
30
30
private List < Task > _pendingTasks ;
31
31
32
32
/// <summary>
@@ -206,7 +206,7 @@ private ComponentState AttachAndInitComponent(IComponent component, int parentCo
206
206
/// A <see cref="Task"/> which will complete once all asynchronous processing related to the event
207
207
/// has completed.
208
208
/// </returns>
209
- public virtual Task DispatchEventAsync ( int eventHandlerId , EventFieldInfo fieldInfo , UIEventArgs eventArgs )
209
+ public virtual Task DispatchEventAsync ( ulong eventHandlerId , EventFieldInfo fieldInfo , UIEventArgs eventArgs )
210
210
{
211
211
EnsureSynchronizationContext ( ) ;
212
212
@@ -354,15 +354,15 @@ protected internal virtual void AddToRenderQueue(int componentId, RenderFragment
354
354
}
355
355
}
356
356
357
- internal void TrackReplacedEventHandlerId ( int oldEventHandlerId , int newEventHandlerId )
357
+ internal void TrackReplacedEventHandlerId ( ulong oldEventHandlerId , ulong newEventHandlerId )
358
358
{
359
359
// Tracking the chain of old->new replacements allows us to interpret incoming EventFieldInfo
360
360
// values even if they refer to an event handler ID that's since been superseded. This is essential
361
361
// for tree patching to work in an async environment.
362
362
_eventHandlerIdReplacements . Add ( oldEventHandlerId , newEventHandlerId ) ;
363
363
}
364
364
365
- private int FindLatestEventHandlerIdInChain ( int eventHandlerId )
365
+ private ulong FindLatestEventHandlerIdInChain ( ulong eventHandlerId )
366
366
{
367
367
while ( _eventHandlerIdReplacements . TryGetValue ( eventHandlerId , out var replacementEventHandlerId ) )
368
368
{
@@ -573,7 +573,7 @@ private void RenderInExistingBatch(RenderQueueEntry renderQueueEntry)
573
573
}
574
574
}
575
575
576
- private void RemoveEventHandlerIds ( ArrayRange < int > eventHandlerIds , Task afterTaskIgnoreErrors )
576
+ private void RemoveEventHandlerIds ( ArrayRange < ulong > eventHandlerIds , Task afterTaskIgnoreErrors )
577
577
{
578
578
if ( eventHandlerIds . Count == 0 )
579
579
{
@@ -598,7 +598,7 @@ private void RemoveEventHandlerIds(ArrayRange<int> eventHandlerIds, Task afterTa
598
598
599
599
// Factor out the async part into a separate local method purely so, in the
600
600
// synchronous case, there's no state machine or task construction
601
- async Task ContinueAfterTask ( ArrayRange < int > eventHandlerIds , Task afterTaskIgnoreErrors )
601
+ async Task ContinueAfterTask ( ArrayRange < ulong > eventHandlerIds , Task afterTaskIgnoreErrors )
602
602
{
603
603
// We need to delay the actual removal (e.g., until we've confirmed the client
604
604
// has processed the batch and hence can be sure not to reuse the handler IDs
@@ -637,7 +637,7 @@ private async Task GetErrorHandledTask(Task taskToHandle)
637
637
}
638
638
}
639
639
640
- private void UpdateRenderTreeToMatchClientState ( int eventHandlerId , EventFieldInfo fieldInfo )
640
+ private void UpdateRenderTreeToMatchClientState ( ulong eventHandlerId , EventFieldInfo fieldInfo )
641
641
{
642
642
var componentState = GetOptionalComponentState ( fieldInfo . ComponentId ) ;
643
643
if ( componentState != null )
0 commit comments