Export (0) Print
Expand All

ProjectItem.Kind Property

Gets a GUID string indicating the kind or type of the object.

Namespace:  EnvDTE
Assembly:  EnvDTE (in EnvDTE.dll)

string Kind { get; }

Property Value

Type: System.String
A GUID string representing the type of object. The return value should be converted to a proper Guid or a platform-equivalent type before doing comparisons using native GUID data types. This ensures that differences in the string formatting of the GUID across different project systems and clients (such as capitalization and use of braces) don't cause incorrect results from equality checks.

If you are providing a new type of project item, you must provide a unique GUID string to identify it, and make this information available in your tool, type library, or documentation.

public void KindExample2(DTE2 dte)
    // Before running this example, open a project.

    Project proj = dte.Solution.Projects.Item(1);
    string msg = "";

    foreach (ProjectItem item in proj.ProjectItems)
        msg += "    " + item.Name + "  [Kind = " + item.Kind + "]\n";

    MessageBox.Show(proj.Name + "  [Kind = " + proj.Kind + 
        "] has the following project items:\n\n" + msg); 

© 2014 Microsoft