VsTaskLibraryHelper.CreateTask Method (IVsTaskSchedulerService, VsTaskRunContext, IVsTaskBody)
Creates a task that is run on the given context.
Namespace: Microsoft.VisualStudio.Shell
Assembly: Microsoft.VisualStudio.Shell.11.0 (in Microsoft.VisualStudio.Shell.11.0.dll)
Syntax
'宣告
<ExtensionAttribute> _
Public Shared Function CreateTask ( _
service As IVsTaskSchedulerService, _
context As VsTaskRunContext, _
taskBody As IVsTaskBody _
) As IVsTask
public static IVsTask CreateTask(
this IVsTaskSchedulerService service,
VsTaskRunContext context,
IVsTaskBody taskBody
)
Parameters
- service
Type: Microsoft.VisualStudio.Shell.Interop.IVsTaskSchedulerService
[in] The task scheduler service to use to create the task.
- context
Type: Microsoft.VisualStudio.Shell.VsTaskRunContext
[in] Where to run this task.
- taskBody
Type: Microsoft.VisualStudio.Shell.Interop.IVsTaskBody
[in] Action to be executed.
Return Value
Type: Microsoft.VisualStudio.Shell.Interop.IVsTask
The task scheduler service that is creating the task to run.
Usage Note
In Visual Basic and C#, you can call this method as an instance method on any object of type IVsTaskSchedulerService. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).
.NET Framework Security
- Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see Using Libraries from Partially Trusted Code.