Files
2026-06-04 11:42:34 +02:00

42 lines
1.8 KiB
C#

using System;
using System.Threading;
namespace System.ComponentModel
{
/// <summary>Provides concurrency management for classes that support asynchronous method calls. This class cannot be inherited.</summary>
// Token: 0x02000056 RID: 86
public static class AsyncOperationManager
{
/// <summary>Gets or sets the synchronization context for the asynchronous operation.</summary>
/// <returns>The synchronization context for the asynchronous operation.</returns>
// Token: 0x170000E8 RID: 232
// (get) Token: 0x06000350 RID: 848 RVA: 0x0000A40C File Offset: 0x0000860C
// (set) Token: 0x06000351 RID: 849 RVA: 0x0000A428 File Offset: 0x00008628
[EditorBrowsable(EditorBrowsableState.Advanced)]
public static SynchronizationContext SynchronizationContext
{
get
{
if (SynchronizationContext.Current == null)
{
SynchronizationContext.SetSynchronizationContext(new SynchronizationContext());
}
return SynchronizationContext.Current;
}
set
{
SynchronizationContext.SetSynchronizationContext(value);
}
}
/// <summary>Returns an <see cref="T:System.ComponentModel.AsyncOperation" /> for tracking the duration of a particular asynchronous operation.</summary>
/// <returns>An <see cref="T:System.ComponentModel.AsyncOperation" /> that you can use to track the duration of an asynchronous method invocation.</returns>
/// <param name="userSuppliedState">An object used to associate a piece of client state, such as a task ID, with a particular asynchronous operation. </param>
// Token: 0x06000352 RID: 850 RVA: 0x0000A430 File Offset: 0x00008630
public static AsyncOperation CreateOperation(object userSuppliedState)
{
return new AsyncOperation(AsyncOperationManager.SynchronizationContext, userSuppliedState);
}
}
}