共用方式為


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 命名空間

其他資源

如何:編譯和執行 Automation 物件模型程式碼範例

使用程式碼模型探索程式碼 (Visual Basic)

使用程式碼模型探索程式碼 (Visual C#)