80 references to Register
Aspire.Dashboard (1)
Components\Pages\ConsoleLogs.razor.cs (1)
52_cts.Token.Register(static state =>
Aspire.Hosting (4)
Dcp\DcpHost.cs (1)
352using 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 (1)
Commands\Test\MTP\IPC\HttpTestHostGateway.cs (1)
39_cancellationRegistration = cancellationToken.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))
dotnet-watch (1)
Watch\DotNetWatcher.cs (1)
16shutdownCancellationToken.Register(state => ((TaskCompletionSource)state!).TrySetResult(),
GenerateDocumentationAndConfigFiles (2)
src\roslyn\src\Dependencies\Threading\AsyncBatchingWorkQueue`2.cs (1)
133_externalCancellationTokenRegistration = cancellationToken.Register(static @this => ((AsyncBatchingWorkQueue<TItem, TResult>)@this!).Dispose(), this);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\AsyncLazy`1.cs (1)
566_cancellationTokenRegistration = cancellationToken.Register(callback, this);
Microsoft.AspNetCore.Components (1)
Routing\Router.cs (1)
364navigateContext.CancellationToken.Register(state =>
Microsoft.AspNetCore.Components.Web (1)
Virtualization\Virtualize.cs (1)
334using var renderReg = token.Register(static state => ((TaskCompletionSource)state!).TrySetCanceled(), renderCommitTcs);
Microsoft.AspNetCore.Grpc.JsonTranscoding (1)
Internal\HttpContextStreamWriter.cs (1)
50registration = cancellationToken.Register(
Microsoft.AspNetCore.Hosting (1)
WebHostExtensions.cs (1)
156cancellationToken.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 (4)
HubConnection.cs (2)
1011var registration = cancellationToken.Register(static state => 1362var registration = cancellationToken.Register(static state =>
Internal\InvocationRequest.cs (1)
31_cancellationTokenRegistration = cancellationToken.Register(self => ((InvocationRequest)self!).Cancel(), this);
src\aspnetcore\src\SignalR\common\Shared\AsyncEnumerableAdapters.cs (1)
87var registration = cancellationToken.Register((ctsState) =>
Microsoft.AspNetCore.SignalR.Core (3)
HubConnectionContext.cs (2)
88_closedRegistration = connectionContext.ConnectionClosed.Register(static (state) => ((HubConnectionContext)state!).Abort(), this); 93_closedRequestedRegistration = lifetimeNotification.ConnectionClosedRequested.Register(static (state) => ((HubConnectionContext)state!).AbortAllowReconnect(), this);
src\aspnetcore\src\SignalR\common\Shared\AsyncEnumerableAdapters.cs (1)
87var registration = cancellationToken.Register((ctsState) =>
Microsoft.CodeAnalysis.Analyzers (3)
src\roslyn\src\Dependencies\Threading\AsyncBatchingWorkQueue`2.cs (1)
133_externalCancellationTokenRegistration = cancellationToken.Register(static @this => ((AsyncBatchingWorkQueue<TItem, TResult>)@this!).Dispose(), this);
src\roslyn\src\Dependencies\Threading\ParallelExtensions.NetFramework.cs (1)
437_registration = cancellationToken.Register(static o => ((ForEachAsyncState<TSource>)o!).Cancellation.Cancel(), this);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\AsyncLazy`1.cs (1)
566_cancellationTokenRegistration = cancellationToken.Register(callback, this);
Microsoft.CodeAnalysis.AnalyzerUtilities (3)
src\roslyn\src\Dependencies\Threading\AsyncBatchingWorkQueue`2.cs (1)
133_externalCancellationTokenRegistration = cancellationToken.Register(static @this => ((AsyncBatchingWorkQueue<TItem, TResult>)@this!).Dispose(), this);
src\roslyn\src\Dependencies\Threading\ParallelExtensions.NetFramework.cs (1)
437_registration = cancellationToken.Register(static o => ((ForEachAsyncState<TSource>)o!).Cancellation.Cancel(), this);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\AsyncLazy`1.cs (1)
566_cancellationTokenRegistration = cancellationToken.Register(callback, this);
Microsoft.CodeAnalysis.CodeStyle (3)
src\roslyn\src\Dependencies\Threading\AsyncBatchingWorkQueue`2.cs (1)
133_externalCancellationTokenRegistration = cancellationToken.Register(static @this => ((AsyncBatchingWorkQueue<TItem, TResult>)@this!).Dispose(), this);
src\roslyn\src\Dependencies\Threading\ParallelExtensions.NetFramework.cs (1)
437_registration = cancellationToken.Register(static o => ((ForEachAsyncState<TSource>)o!).Cancellation.Cancel(), this);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\AsyncLazy`1.cs (1)
566_cancellationTokenRegistration = cancellationToken.Register(callback, this);
Microsoft.CodeAnalysis.ResxSourceGenerator (3)
src\roslyn\src\Dependencies\Threading\AsyncBatchingWorkQueue`2.cs (1)
133_externalCancellationTokenRegistration = cancellationToken.Register(static @this => ((AsyncBatchingWorkQueue<TItem, TResult>)@this!).Dispose(), this);
src\roslyn\src\Dependencies\Threading\ParallelExtensions.NetFramework.cs (1)
437_registration = cancellationToken.Register(static o => ((ForEachAsyncState<TSource>)o!).Cancellation.Cancel(), this);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\AsyncLazy`1.cs (1)
566_cancellationTokenRegistration = cancellationToken.Register(callback, this);
Microsoft.CodeAnalysis.Workspaces (2)
src\roslyn\src\Dependencies\Threading\AsyncBatchingWorkQueue`2.cs (1)
133_externalCancellationTokenRegistration = cancellationToken.Register(static @this => ((AsyncBatchingWorkQueue<TItem, TResult>)@this!).Dispose(), this);
src\roslyn\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.FileProviders.Physical (1)
PhysicalFilesWatcher.cs (1)
786newWatcher.Token.Register(_ => TryEnableFileSystemWatcher(), null);
Microsoft.Extensions.Hosting (3)
Internal\ConsoleLifetime.cs (2)
80_applicationStartedRegistration = ApplicationLifetime.ApplicationStarted.Register(state => 85_applicationStoppingRegistration = ApplicationLifetime.ApplicationStopping.Register(state =>
Internal\Host.cs (1)
398using (cancellationToken.Register(s => ((TaskCompletionSource<object?>)s!).TrySetCanceled(), tcs))
Microsoft.Extensions.Hosting.Abstractions (1)
HostingAbstractionsHostExtensions.cs (1)
94using var _ = token.Register(static 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)
60return _cancellationTokenSource.Token.Register(callback, state);
Roslyn.Diagnostics.Analyzers (3)
src\roslyn\src\Dependencies\Threading\AsyncBatchingWorkQueue`2.cs (1)
133_externalCancellationTokenRegistration = cancellationToken.Register(static @this => ((AsyncBatchingWorkQueue<TItem, TResult>)@this!).Dispose(), this);
src\roslyn\src\Dependencies\Threading\ParallelExtensions.NetFramework.cs (1)
437_registration = cancellationToken.Register(static o => ((ForEachAsyncState<TSource>)o!).Cancellation.Cancel(), this);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\AsyncLazy`1.cs (1)
566_cancellationTokenRegistration = cancellationToken.Register(callback, this);
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)
965return cancellationToken.Register(static s =>
System\Net\Http\SocketsHttpHandler\SocksHelper.cs (1)
34using (cancellationToken.Register(s => ((Stream)s!).Dispose(), stream))
System.Net.Http.WinHttpHandler (3)
System\Net\Http\WinHttpHandler.cs (1)
933using (state.CancellationToken.Register(static s =>
System\Net\Http\WinHttpResponseStream.cs (2)
116using var ctr = cancellationToken.Register(s => ((WinHttpResponseStream)s!).CancelPendingResponseStreamReadOperation(), this); 220using var ctr = token.Register(s => ((WinHttpResponseStream)s!).CancelPendingResponseStreamReadOperation(), this);
System.Net.WebSockets (2)
System\Net\WebSockets\ManagedWebSocket.cs (2)
608using (cancellationToken.Register(static s => ((ManagedWebSocket)s!).Abort(), this)) 790registration = cancellationToken.Register(static s => ((ManagedWebSocket)s!).Abort(), this);
System.Net.WebSockets.Client (1)
System\Net\WebSockets\BrowserWebSockets\BrowserWebSocket.cs (1)
569using (var receiveRegistration = cancellationToken.Register(static s =>
System.Runtime.InteropServices.JavaScript (1)
System\Runtime\InteropServices\JavaScript\JSHostImplementation.cs (1)
99using (var receiveRegistration = cancellationToken.Register(static s =>
System.Threading.Tasks.Dataflow (3)
Base\DataflowBlock.cs (3)
405_cancellationRegistration = cancellationToken.Register( 1050target._regFromExternalCancellationToken = cancellationToken.Register(_cancelCts, target._cts); 1072target._cts.Token.Register(
System.Windows.Extensions (1)
System\Media\SoundPlayer.cs (1)
493using (cancellationToken.Register(r => ((WebRequest)r!).Abort(), webRequest))