Source.CreateErrorTaskItem Method

Definition

Creates an instance of a DocumentTask object representing a parsing error.

Overloads

CreateErrorTaskItem(TextSpan, MARKERTYPE, String)

Creates a new error task item for the Error List, for the supplied text, marker type, and file name.

CreateErrorTaskItem(TextSpan, String, String, TaskPriority, TaskCategory, MARKERTYPE, TaskErrorCategory)

Creates a new error task item for the Error List, for the supplied text, file name, message, priority, category, marker type, and error type.

Remarks

These methods are typically called to create a new DocumentTask object to show an error in the Task window. Each method bundles a text marker, source file span, and source file name in a DocumentTask object then returns that object.

The DocumentTask object is used when a user double-clicks on the item in the error Task window; the source file is opened (if not already open) and the cursor is positioned at the specified span.

CreateErrorTaskItem(TextSpan, MARKERTYPE, String)

Creates a new error task item for the Error List, for the supplied text, marker type, and file name.

public:
 virtual Microsoft::VisualStudio::Package::DocumentTask ^ CreateErrorTaskItem(Microsoft::VisualStudio::TextManager::Interop::TextSpan span, Microsoft::VisualStudio::TextManager::Interop::MARKERTYPE markerType, System::String ^ filename);
public virtual Microsoft.VisualStudio.Package.DocumentTask CreateErrorTaskItem (Microsoft.VisualStudio.TextManager.Interop.TextSpan span, Microsoft.VisualStudio.TextManager.Interop.MARKERTYPE markerType, string filename);
abstract member CreateErrorTaskItem : Microsoft.VisualStudio.TextManager.Interop.TextSpan * Microsoft.VisualStudio.TextManager.Interop.MARKERTYPE * string -> Microsoft.VisualStudio.Package.DocumentTask
override this.CreateErrorTaskItem : Microsoft.VisualStudio.TextManager.Interop.TextSpan * Microsoft.VisualStudio.TextManager.Interop.MARKERTYPE * string -> Microsoft.VisualStudio.Package.DocumentTask
Public Overridable Function CreateErrorTaskItem (span As TextSpan, markerType As MARKERTYPE, filename As String) As DocumentTask

Parameters

span
TextSpan

A TextSpan structure, which defines a block of text.

markerType
MARKERTYPE

A member of the Microsoft.VisualStudio.TextManager.MARKERTYPE enumeration.

filename
String

The name of the file.

Returns

A new instance of DocumentTask.

Applies to

CreateErrorTaskItem(TextSpan, String, String, TaskPriority, TaskCategory, MARKERTYPE, TaskErrorCategory)

Creates a new error task item for the Error List, for the supplied text, file name, message, priority, category, marker type, and error type.

public:
 virtual Microsoft::VisualStudio::Package::DocumentTask ^ CreateErrorTaskItem(Microsoft::VisualStudio::TextManager::Interop::TextSpan span, System::String ^ filename, System::String ^ message, Microsoft::VisualStudio::Shell::TaskPriority priority, Microsoft::VisualStudio::Shell::TaskCategory category, Microsoft::VisualStudio::TextManager::Interop::MARKERTYPE markerType, Microsoft::VisualStudio::Shell::TaskErrorCategory errorCategory);
public virtual Microsoft.VisualStudio.Package.DocumentTask CreateErrorTaskItem (Microsoft.VisualStudio.TextManager.Interop.TextSpan span, string filename, string message, Microsoft.VisualStudio.Shell.TaskPriority priority, Microsoft.VisualStudio.Shell.TaskCategory category, Microsoft.VisualStudio.TextManager.Interop.MARKERTYPE markerType, Microsoft.VisualStudio.Shell.TaskErrorCategory errorCategory);
abstract member CreateErrorTaskItem : Microsoft.VisualStudio.TextManager.Interop.TextSpan * string * string * Microsoft.VisualStudio.Shell.TaskPriority * Microsoft.VisualStudio.Shell.TaskCategory * Microsoft.VisualStudio.TextManager.Interop.MARKERTYPE * Microsoft.VisualStudio.Shell.TaskErrorCategory -> Microsoft.VisualStudio.Package.DocumentTask
override this.CreateErrorTaskItem : Microsoft.VisualStudio.TextManager.Interop.TextSpan * string * string * Microsoft.VisualStudio.Shell.TaskPriority * Microsoft.VisualStudio.Shell.TaskCategory * Microsoft.VisualStudio.TextManager.Interop.MARKERTYPE * Microsoft.VisualStudio.Shell.TaskErrorCategory -> Microsoft.VisualStudio.Package.DocumentTask
Public Overridable Function CreateErrorTaskItem (span As TextSpan, filename As String, message As String, priority As TaskPriority, category As TaskCategory, markerType As MARKERTYPE, errorCategory As TaskErrorCategory) As DocumentTask

Parameters

span
TextSpan

A TextSpan structure, which defines a block of text.

filename
String

The name of the file.

message
String

The error message.

priority
TaskPriority

A member of the TaskPriority enumeration.

category
TaskCategory

A member of the TaskCategory enumeration.

markerType
MARKERTYPE

A member of the Microsoft.VisualStudio.TextManager.MARKERTYPE enumeration.

errorCategory
TaskErrorCategory

A member of the Microsoft.VisualStudio.Shell.ErrorCategory enumeration, which defines the level of error.

Returns

A new instance of DocumentTask.

Applies to