92 references to Register
Aspire.Dashboard (1)
Components\Pages\ConsoleLogs.razor.cs (1)
53_cts.Token.Register(static state =>
Aspire.Hosting (4)
Dcp\DcpHost.cs (1)
282using var _ = cancellationToken.Register(s => ((NetworkStream)s!).Close(), stream);
InteractionService.cs (3)
92using var _ = cancellationToken.Register(OnInteractionCancellation, state: newState); 165using var _ = cancellationToken.Register(OnInteractionCancellation, state: newState); 233using var _ = cancellationToken.Register(OnInteractionCancellation, state: newState);
Aspire.Hosting.Testing (1)
DistributedApplicationFactory.cs (1)
516using var applicationStartedRegistration = _hostApplicationLifetime?.ApplicationStarted.Register(
dotnet-svcutil-lib (4)
FrameworkFork\System.ServiceModel\Internals\System\Runtime\TimeoutHelper.cs (1)
313token.Register(s_deregisterToken, Tuple.Create(targetTime, tokenSource));
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\HttpChannelFactory.cs (1)
936timeoutToken.Register(s_cancelCts, _httpSendCts);
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\ProducerConsumerStream.cs (2)
73using (cancellationToken.Register(CancelAndDispose, this)) 130using (cancellationToken.Register(CancelAndDispose, this))
GenerateDocumentationAndConfigFiles (1)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\AsyncLazy`1.cs (1)
566_cancellationTokenRegistration = cancellationToken.Register(callback, this);
InMemory.FunctionalTests (1)
Http2\PipeReaderFactory.cs (1)
33using (var registration = cancellationToken.Register(_cancelReader, pipe.Reader))
Metrics (2)
src\Dependencies\Threading\ParallelExtensions.NetFramework.cs (1)
437_registration = cancellationToken.Register(static o => ((ForEachAsyncState<TSource>)o!).Cancellation.Cancel(), this);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\AsyncLazy`1.cs (1)
566_cancellationTokenRegistration = cancellationToken.Register(callback, this);
Metrics.Legacy (2)
src\Dependencies\Threading\ParallelExtensions.NetFramework.cs (1)
437_registration = cancellationToken.Register(static o => ((ForEachAsyncState<TSource>)o!).Cancellation.Cancel(), this);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\AsyncLazy`1.cs (1)
566_cancellationTokenRegistration = cancellationToken.Register(callback, this);
Microsoft.AspNetCore.Components (1)
Routing\Router.cs (1)
358navigateContext.CancellationToken.Register(state =>
Microsoft.AspNetCore.Grpc.JsonTranscoding (1)
Internal\HttpContextStreamWriter.cs (1)
50registration = cancellationToken.Register(
Microsoft.AspNetCore.Hosting (1)
WebHostExtensions.cs (1)
156cancellationToken.Register(state =>
Microsoft.AspNetCore.Hosting.Tests (1)
WebHostTests.cs (1)
1139token.Register(state =>
Microsoft.AspNetCore.Http (1)
Features\FormFeature.cs (1)
208using (cancellationToken.Register((state) => ((HttpContext)state!).Abort(), _request.HttpContext))
Microsoft.AspNetCore.Server.HttpSys (2)
MessagePump.cs (1)
224using var registration = cancellationToken.Register(static state =>
RequestProcessing\RequestContext.cs (1)
191return cancellationToken.Register(AbortDelegate, this);
Microsoft.AspNetCore.Server.IIS (1)
Core\IISHttpServer.cs (1)
121_cancellationTokenRegistration = cancellationToken.Register((shutdownSignal) =>
Microsoft.AspNetCore.Server.Kestrel.Core (4)
Internal\HttpConnection.cs (2)
114using var shutdownRegistration = connectionLifetimeNotificationFeature?.ConnectionClosedRequested.Register(state => ((HttpConnection)state!).StopProcessingNextRequest(ConnectionEndReason.GracefulAppShutdown), this); 117using var closedRegistration = _context.ConnectionContext.ConnectionClosed.Register(state => ((HttpConnection)state!).OnConnectionClosed(), this);
Internal\WebTransport\WebTransportSession.cs (1)
55_connectionClosedRegistration = connection._multiplexedContext.ConnectionClosed.Register(static state =>
Internal\WebTransport\WebTransportStream.cs (1)
64_connectionClosedRegistration = context.StreamContext.ConnectionClosed.Register(static state =>
Microsoft.AspNetCore.SignalR.Client.Core (3)
HubConnection.cs (1)
754cancellationToken.Register(state => _ = OnStreamCanceled((InvocationRequest)state!), irq);
Internal\InvocationRequest.cs (1)
30_cancellationTokenRegistration = cancellationToken.Register(self => ((InvocationRequest)self!).Cancel(), this);
src\SignalR\common\Shared\AsyncEnumerableAdapters.cs (1)
87var registration = cancellationToken.Register((ctsState) =>
Microsoft.AspNetCore.SignalR.Client.Tests (1)
ServerSentEventsTransportTests.cs (1)
329cancellationToken.Register(s => ((SyncPoint)s).Continue(), sendSyncPoint);
Microsoft.AspNetCore.SignalR.Core (3)
HubConnectionContext.cs (2)
82_closedRegistration = connectionContext.ConnectionClosed.Register(static (state) => ((HubConnectionContext)state!).Abort(), this); 87_closedRequestedRegistration = lifetimeNotification.ConnectionClosedRequested.Register(static (state) => ((HubConnectionContext)state!).AbortAllowReconnect(), this);
src\SignalR\common\Shared\AsyncEnumerableAdapters.cs (1)
87var registration = cancellationToken.Register((ctsState) =>
Microsoft.AspNetCore.SignalR.Tests (10)
DefaultHubLifetimeManagerTests.cs (9)
44connection2.ConnectionAborted.Register(t => 70connection2.ConnectionAborted.Register(t => 94connection1.ConnectionAborted.Register(t => 116connection1.ConnectionAborted.Register(t => 139connection1.ConnectionAborted.Register(t => 166connection2.ConnectionAborted.Register(t => 191connection1.ConnectionAborted.Register(t => 220connection2.ConnectionAborted.Register(t => 250connection2.ConnectionAborted.Register(t =>
HubConnectionHandlerTestUtils\Hubs.cs (1)
333Context.ConnectionAborted.Register(state => ((TaskCompletionSource)state).SetResult(), tcs);
Microsoft.AspNetCore.SignalR.Tests.Utils (1)
CancellationTokenExtensions.cs (1)
11token.Register((t) =>
Microsoft.CodeAnalysis.Analyzers (2)
src\Dependencies\Threading\ParallelExtensions.NetFramework.cs (1)
437_registration = cancellationToken.Register(static o => ((ForEachAsyncState<TSource>)o!).Cancellation.Cancel(), this);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\AsyncLazy`1.cs (1)
566_cancellationTokenRegistration = cancellationToken.Register(callback, this);
Microsoft.CodeAnalysis.AnalyzerUtilities (2)
src\Dependencies\Threading\ParallelExtensions.NetFramework.cs (1)
437_registration = cancellationToken.Register(static o => ((ForEachAsyncState<TSource>)o!).Cancellation.Cancel(), this);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\AsyncLazy`1.cs (1)
566_cancellationTokenRegistration = cancellationToken.Register(callback, this);
Microsoft.CodeAnalysis.BannedApiAnalyzers (2)
src\Dependencies\Threading\ParallelExtensions.NetFramework.cs (1)
437_registration = cancellationToken.Register(static o => ((ForEachAsyncState<TSource>)o!).Cancellation.Cancel(), this);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\AsyncLazy`1.cs (1)
566_cancellationTokenRegistration = cancellationToken.Register(callback, this);
Microsoft.CodeAnalysis.CodeStyle (2)
src\Dependencies\Threading\ParallelExtensions.NetFramework.cs (1)
437_registration = cancellationToken.Register(static o => ((ForEachAsyncState<TSource>)o!).Cancellation.Cancel(), this);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\AsyncLazy`1.cs (1)
566_cancellationTokenRegistration = cancellationToken.Register(callback, this);
Microsoft.CodeAnalysis.EditorFeatures (1)
Tagging\TaggerMainThreadManager.cs (1)
86var registration = _threadingContext.DisposalToken.Register(
Microsoft.CodeAnalysis.InteractiveHost (2)
src\Dependencies\Threading\ParallelExtensions.NetFramework.cs (1)
437_registration = cancellationToken.Register(static o => ((ForEachAsyncState<TSource>)o!).Cancellation.Cancel(), this);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\AsyncLazy`1.cs (1)
566_cancellationTokenRegistration = cancellationToken.Register(callback, this);
Microsoft.CodeAnalysis.PerformanceSensitiveAnalyzers (2)
src\Dependencies\Threading\ParallelExtensions.NetFramework.cs (1)
437_registration = cancellationToken.Register(static o => ((ForEachAsyncState<TSource>)o!).Cancellation.Cancel(), this);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\AsyncLazy`1.cs (1)
566_cancellationTokenRegistration = cancellationToken.Register(callback, this);
Microsoft.CodeAnalysis.PublicApiAnalyzers (2)
src\Dependencies\Threading\ParallelExtensions.NetFramework.cs (1)
437_registration = cancellationToken.Register(static o => ((ForEachAsyncState<TSource>)o!).Cancellation.Cancel(), this);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\AsyncLazy`1.cs (1)
566_cancellationTokenRegistration = cancellationToken.Register(callback, this);
Microsoft.CodeAnalysis.ResxSourceGenerator (2)
src\Dependencies\Threading\ParallelExtensions.NetFramework.cs (1)
437_registration = cancellationToken.Register(static o => ((ForEachAsyncState<TSource>)o!).Cancellation.Cancel(), this);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\AsyncLazy`1.cs (1)
566_cancellationTokenRegistration = cancellationToken.Register(callback, this);
Microsoft.CodeAnalysis.Workspaces (1)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\AsyncLazy`1.cs (1)
566_cancellationTokenRegistration = cancellationToken.Register(callback, this);
Microsoft.Extensions.Caching.Hybrid (1)
Internal\DefaultHybridCache.StampedeStateT.cs (1)
91using CancellationTokenRegistration reg = token.Register(static obj =>
Microsoft.Extensions.Hosting (2)
Internal\ConsoleLifetime.cs (2)
80_applicationStartedRegistration = ApplicationLifetime.ApplicationStarted.Register(state => 85_applicationStoppingRegistration = ApplicationLifetime.ApplicationStopping.Register(state =>
Microsoft.Extensions.Hosting.Abstractions (1)
HostingAbstractionsHostExtensions.cs (1)
94token.Register(state =>
Microsoft.Extensions.Hosting.Systemd (2)
SystemdLifetime.cs (2)
75_applicationStartedRegistration = ApplicationLifetime.ApplicationStarted.Register(state => 80_applicationStoppingRegistration = ApplicationLifetime.ApplicationStopping.Register(state =>
Microsoft.Extensions.ML (1)
ModelReloadToken.cs (1)
42public IDisposable RegisterChangeCallback(Action<object> callback, object state) => _cts.Token.Register(callback, state);
Microsoft.Extensions.Primitives (1)
CompositeChangeToken.cs (1)
58return _cancellationTokenSource.Token.Register(callback, state);
Roslyn.Diagnostics.Analyzers (2)
src\Dependencies\Threading\ParallelExtensions.NetFramework.cs (1)
437_registration = cancellationToken.Register(static o => ((ForEachAsyncState<TSource>)o!).Cancellation.Cancel(), this);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\AsyncLazy`1.cs (1)
566_cancellationTokenRegistration = cancellationToken.Register(callback, this);
SignalR.Client.FunctionalTestApp (1)
TestHub.cs (1)
75token.Register(async (state) =>
System.Data.Common (3)
System\Data\Common\DbCommand.cs (3)
132registration = cancellationToken.Register(s => ((DbCommand)s!).CancelIgnoreFailure(), this); 173registration = cancellationToken.Register(s => ((DbCommand)s!).CancelIgnoreFailure(), this); 205registration = cancellationToken.Register(s => ((DbCommand)s!).CancelIgnoreFailure(), this);
System.IO.Ports (1)
System\IO\Ports\SerialStream.Unix.cs (1)
1087_cancellationTokenRegistration = ct.Register(s =>
System.Net.Http (5)
System\Net\Http\HttpContent.cs (1)
407CancellationTokenRegistration cancellationRegistration = cancellationToken.Register(static s => ((HttpContent)s!).Dispose(), this);
System\Net\Http\SocketsHttpHandler\ChunkedEncodingReadStream.cs (1)
512ctr = cts.Token.Register(static s => ((HttpConnection)s!).Dispose(), _connection);
System\Net\Http\SocketsHttpHandler\ContentLengthReadStream.cs (1)
224ctr = cts.Token.Register(static s => ((HttpConnection)s!).Dispose(), _connection);
System\Net\Http\SocketsHttpHandler\HttpConnection.cs (1)
962return cancellationToken.Register(static s =>
System\Net\Http\SocketsHttpHandler\SocksHelper.cs (1)
34using (cancellationToken.Register(s => ((Stream)s!).Dispose(), stream))
System.Net.WebSockets (2)
System\Net\WebSockets\ManagedWebSocket.cs (2)
601using (cancellationToken.Register(static s => ((ManagedWebSocket)s!).Abort(), this)) 782registration = cancellationToken.Register(static s => ((ManagedWebSocket)s!).Abort(), this);
System.Threading.Tasks.Dataflow (3)
Base\DataflowBlock.cs (3)
405_cancellationRegistration = cancellationToken.Register( 1050target._regFromExternalCancellationToken = cancellationToken.Register(_cancelCts, target._cts); 1072target._cts.Token.Register(
Test.Utilities (1)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\AsyncLazy`1.cs (1)
566_cancellationTokenRegistration = cancellationToken.Register(callback, this);
Text.Analyzers (2)
src\Dependencies\Threading\ParallelExtensions.NetFramework.cs (1)
437_registration = cancellationToken.Register(static o => ((ForEachAsyncState<TSource>)o!).Cancellation.Cancel(), this);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\AsyncLazy`1.cs (1)
566_cancellationTokenRegistration = cancellationToken.Register(callback, this);