CodeModel2.IsCaseSensitive 属性

获取一个值,该值指示当前语言是否区分大小写。

命名空间:  EnvDTE80
程序集:  EnvDTE80(在 EnvDTE80.dll 中)

语法

声明
ReadOnly Property IsCaseSensitive As Boolean
bool IsCaseSensitive { get; }
property bool IsCaseSensitive {
    bool get ();
}
abstract IsCaseSensitive : bool with get
function get IsCaseSensitive () : boolean

属性值

类型:Boolean
一个布尔值,如果当前语言区分大小写,该值为 true;否则为 false。

备注

备注

在进行某些类型的编辑之后,代码模型元素(如类、结构、函数、特性、委托等)的值可能是非确定性的,这意味着不能指望它们的值总是保持不变。有关更多信息,请参见 使用代码模型查找代码 (Visual Basic) 中的“代码模型元素的值可能会更改”一节。

示例

Sub IsCaseSensitiveExample(ByVal dte As DTE2)

    ' Before running this example, open a solution that contains one 
    ' or more projects.
    Dim msg As String
    Dim proj As Project
    For Each proj In dte.Solution.Projects
        If proj.CodeModel.IsCaseSensitive Then
            msg &= proj.Name & " uses a case-sensitive language" & _
                vbCrLf
        Else
            msg &= proj.Name & " uses a case-insensitive language" & _
                vbCrLf
        End If
    Next

    ' Display the case-sensitivity of the solution's projects.
    MsgBox(msg)

End Sub
public void IsCaseSensitiveExample(DTE2 dte)
{
    // Before running this example, open a solution that contains one 
    // or more projects.
    string msg = "";
    foreach (Project proj in dte.Solution.Projects)
    {
        if (proj.CodeModel.IsCaseSensitive)
            msg += proj.Name + " uses a case-sensitive language" + 
                Environment.NewLine;
        else
            msg += proj.Name + " uses a case-insensitive language" + 
                Environment.NewLine;
    }

    // Display the case-sensitivity of the solution's projects.
    MessageBox.Show(msg);
}

.NET Framework 安全性

请参阅

参考

CodeModel2 接口

EnvDTE80 命名空间

其他资源

如何:编译和运行自动化对象模型代码示例

使用代码模型查找代码 (Visual Basic)

使用代码模型查找代码 (Visual C#)