IntelliSense为函数提供了一个Class图标

时间:2015-11-19 17:05:29

标签: .net vb.net visual-studio intellisense

我正在使用 Visual Studio 2013 Ultimate ,下面的代码是用Vb.Net编写的。

我遇到的问题是 IntelliSense 为函数提供了 the icon of a Class

enter image description here

我想知道导致此行为的原因,如果是错误或我的代码存在问题。

这是代码:

Public NotInheritable Class ProcessUtil

    ''' ----------------------------------------------------------------------------------------------------
    ''' <summary>
    ''' Performs a WMI query to Win32_Process class with the specified condition and returns the result.
    ''' </summary>
    ''' ----------------------------------------------------------------------------------------------------
    ''' <remarks>
    ''' This is useful for example to get information of a 64-Bit process from a 32-Bit .Net assembly.
    ''' </remarks>
    ''' ----------------------------------------------------------------------------------------------------
    ''' <example> This is a code example.
    ''' <code>
    ''' Dim condition As New KeyValuePair(Of String, String)("Name", "notepad.exe")
    ''' 
    ''' For Each mo As ManagementObject In ProcessUtil.GetWmiProcessQuery(condition)
    ''' 
    '''     MessageBox.Show(DirectCast(mo.Properties("ExecutablePath").Value, String))
    ''' 
    ''' Next mo
    ''' </code>
    ''' </example>
    ''' ----------------------------------------------------------------------------------------------------
    ''' <param name="condition">
    ''' The WHERE condition to use in the SELECT query.
    ''' </param>
    ''' ----------------------------------------------------------------------------------------------------
    ''' <returns>
    ''' The query result.
    ''' </returns>
    ''' ----------------------------------------------------------------------------------------------------
    <DebuggerStepThrough>
    Public Shared Function GetWmiProcessQuery(ByVal condition As KeyValuePair(Of String, String)) As ManagementObject()

        Dim scope As New ManagementScope("root\CIMV2")
        Dim query As New SelectQuery(String.Format("SELECT * FROM Win32_Process Where {0} = '{1}'", condition.Key, condition.Value))
        Dim options As New EnumerationOptions With {.ReturnImmediately = True}

        Using wmi As New ManagementObjectSearcher(scope, query, options)

            Using objCol As ManagementObjectCollection = wmi.Get

                Return objCol.Cast(Of ManagementObject).ToArray

            End Using

        End Using

    End Function

End Class

0 个答案:

没有答案