Partager via


VsTaskLibraryHelper.WithPriority Method

Definition

Creates a JoinableTaskFactory that schedules work with the specified Visual Studio UI thread priority.

public:
[System::Runtime::CompilerServices::Extension]
 static Microsoft::VisualStudio::Threading::JoinableTaskFactory ^ WithPriority(Microsoft::VisualStudio::Threading::JoinableTaskFactory ^ joinableTaskFactory, Microsoft::VisualStudio::Shell::VsTaskRunContext priority);
public static Microsoft.VisualStudio.Threading.JoinableTaskFactory WithPriority (this Microsoft.VisualStudio.Threading.JoinableTaskFactory joinableTaskFactory, Microsoft.VisualStudio.Shell.VsTaskRunContext priority);
static member WithPriority : Microsoft.VisualStudio.Threading.JoinableTaskFactory * Microsoft.VisualStudio.Shell.VsTaskRunContext -> Microsoft.VisualStudio.Threading.JoinableTaskFactory
<Extension()>
Public Function WithPriority (joinableTaskFactory As JoinableTaskFactory, priority As VsTaskRunContext) As JoinableTaskFactory

Parameters

joinableTaskFactory
JoinableTaskFactory

The underlying JoinableTaskFactory to use.

priority
VsTaskRunContext

The priority with which to schedule any work on the UI thread, when and if SwitchToMainThreadAsync(CancellationToken) is called.

Returns

A JoinableTaskFactory that may be used for scheduling async work with the specified priority.

Applies to