次の方法で共有


ToolWindows.ErrorList Property

Definition

Gets the list of errors displayed in the IDE.

public:
 property EnvDTE80::ErrorList ^ ErrorList { EnvDTE80::ErrorList ^ get(); };
public:
 property EnvDTE80::ErrorList ^ ErrorList { EnvDTE80::ErrorList ^ get(); };
[System.Runtime.InteropServices.DispId(10)]
public EnvDTE80.ErrorList ErrorList { [System.Runtime.InteropServices.DispId(10)] get; }
[<System.Runtime.InteropServices.DispId(10)>]
[<get: System.Runtime.InteropServices.DispId(10)>]
member this.ErrorList : EnvDTE80.ErrorList
Public ReadOnly Property ErrorList As ErrorList

Property Value

An error list that can be enumerated for individual errors.

Attributes

Examples

This example opens the Error List window and displays the errors, if present, in a Message Box. Before running this example, build a project with some errors in it.

Imports EnvDTE  
Imports EnvDTE80  
Public Sub GetErrorList(ByVal dte As DTE2)  
    Dim myErrors As ErrorList  
    Dim count As Integer  
    Dim aString As String  
    aString = ""  
    _applicationObject.ExecuteCommand("View.ErrorList", " ")  
    myErrors = _applicationObject.ToolWindows.ErrorList  
    count = myErrors.ErrorItems.Count  
    If count <> 0 Then  
        For k As Integer = 1 To count  
            aString &= _  
           (myErrors.ErrorItems.Item(k).Description.ToString() & vbCr)  
        Next k  
        MsgBox(aString)  
    Else  
         MsgBox("There are no items in the error list.")  
    End If  
End Sub  
using EnvDTE;  
using EnvDTE80;  
using System.Windows.Forms;  
public void GetErrorList(DTE2 dte)  
{  
    ErrorList myErrors;  
    int count;  
    String aString = null;  
    _applicationObject.ExecuteCommand("View.ErrorList", " ");  
    myErrors = _applicationObject.ToolWindows.ErrorList;  
    count = myErrors.ErrorItems.Count;  
    if (count != 0)  
    {  
        for (int i = 1; i <= count; i++)  
        {  
            aString +=  
(myErrors.ErrorItems.Item(i).Description.ToString() + "\n");  
        }  
        MessageBox.Show(aString);  
    }  
    else  
    {  
        MessageBox.Show("There are no items in the error list.");  
    }  
}  

Applies to