Dela via


VsTaskLibraryHelper.CreateTask Method (IVsTaskSchedulerService, VsTaskRunContext, VsTaskCreationOptions, IVsTaskBody, Object)

Creates a task with the specified options that is run on the given context.

Namespace:  Microsoft.VisualStudio.Shell
Assembly:  Microsoft.VisualStudio.Shell.12.0 (in Microsoft.VisualStudio.Shell.12.0.dll)

Syntax

'Declaration
<ExtensionAttribute> _
Public Shared Function CreateTask ( _
    service As IVsTaskSchedulerService, _
    context As VsTaskRunContext, _
    options As VsTaskCreationOptions, _
    taskBody As IVsTaskBody, _
    asyncState As Object _
) As IVsTask
public static IVsTask CreateTask(
    this IVsTaskSchedulerService service,
    VsTaskRunContext context,
    VsTaskCreationOptions options,
    IVsTaskBody taskBody,
    Object asyncState
)
[ExtensionAttribute]
public:
static IVsTask^ CreateTask(
    IVsTaskSchedulerService^ service, 
    VsTaskRunContext context, 
    VsTaskCreationOptions options, 
    IVsTaskBody^ taskBody, 
    Object^ asyncState
)
static member CreateTask : 
        service:IVsTaskSchedulerService * 
        context:VsTaskRunContext * 
        options:VsTaskCreationOptions * 
        taskBody:IVsTaskBody * 
        asyncState:Object -> IVsTask
public static function CreateTask(
    service : IVsTaskSchedulerService, 
    context : VsTaskRunContext, 
    options : VsTaskCreationOptions, 
    taskBody : IVsTaskBody, 
    asyncState : Object
) : IVsTask

Parameters

  • asyncState
    Type: Object

    [in] The asynchronous state for the task.

Return Value

Type: Microsoft.VisualStudio.Shell.Interop.IVsTask
The task scheduler service that's 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

See Also

Reference

VsTaskLibraryHelper Class

CreateTask Overload

Microsoft.VisualStudio.Shell Namespace