CodeModel.IsCaseSensitive 屬性

取得目前程式語言是否區分大小寫。

命名空間:  EnvDTE
組件:  EnvDTE (在 EnvDTE.dll 中)

語法

'宣告
ReadOnly Property IsCaseSensitive As Boolean
    Get
bool IsCaseSensitive { get; }
property bool IsCaseSensitive {
    bool get ();
}
abstract IsCaseSensitive : bool
function get IsCaseSensitive () : boolean

屬性值

型別:System.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 安全性

請參閱

參考

CodeModel 介面

EnvDTE 命名空間

其他資源

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

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

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