CodeLinePragma 類別
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
代表特定檔案中的特定位置。
public ref class CodeLinePragma
public class CodeLinePragma
[System.Runtime.InteropServices.ClassInterface(System.Runtime.InteropServices.ClassInterfaceType.AutoDispatch)]
[System.Runtime.InteropServices.ComVisible(true)]
[System.Serializable]
public class CodeLinePragma
type CodeLinePragma = class
[<System.Runtime.InteropServices.ClassInterface(System.Runtime.InteropServices.ClassInterfaceType.AutoDispatch)>]
[<System.Runtime.InteropServices.ComVisible(true)>]
[<System.Serializable>]
type CodeLinePragma = class
Public Class CodeLinePragma
- 繼承
-
CodeLinePragma
- 屬性
範例
以下程式碼範例示範如何使用該 CodeLinePragma 類別來參考原始碼檔案的特定行。
// Creates a CodeLinePragma that references line 100 of the file "example.cs".
CodeLinePragma pragma = new CodeLinePragma("example.cs", 100);
' Creates a CodeLinePragma that references line 100 of the file "example.cs".
Dim pragma As New CodeLinePragma("example.cs", 100)
備註
CodeLinePragma 可以用來表示檔案中的特定位置。 此類物件常在編譯後被除錯工具用來儲存相關程式碼元素的位置,例如與編譯器警告和錯誤相關的位置參考。
建構函式
| 名稱 | Description |
|---|---|
| CodeLinePragma() |
初始化 CodeLinePragma 類別的新執行個體。 |
| CodeLinePragma(String, Int32) |
初始化 CodeLinePragma 類別的新執行個體。 |
屬性
| 名稱 | Description |
|---|---|
| FileName |
取得或設定相關檔案的名稱。 |
| LineNumber |
取得或設定相關參考的行號。 |
方法
| 名稱 | Description |
|---|---|
| Equals(Object) |
判斷指定的物件是否等於目前的物件。 (繼承來源 Object) |
| GetHashCode() |
做為預設哈希函式。 (繼承來源 Object) |
| GetType() |
取得目前實例的 Type。 (繼承來源 Object) |
| MemberwiseClone() |
建立目前 Object的淺層複本。 (繼承來源 Object) |
| ToString() |
傳回表示目前 物件的字串。 (繼承來源 Object) |