CodeLinePragma 类

定义

表示特定文件内的特定位置。Represents a specific location within a specific file.

public ref class CodeLinePragma
[System.Runtime.InteropServices.ComVisible(true)]
[System.Runtime.InteropServices.ClassInterface(System.Runtime.InteropServices.ClassInterfaceType.AutoDispatch)]
[System.Serializable]
public class CodeLinePragma
type CodeLinePragma = class
Public Class CodeLinePragma
继承
CodeLinePragma
属性

示例

下面的代码示例演示如何使用CodeLinePragma类来引用源文件的特定行。The following code example demonstrates the use of the CodeLinePragma class to reference a specific line of a source file.

// Creates a CodeLinePragma that references line 100 of the file "example.cs".
CodeLinePragma^ pragma = gcnew CodeLinePragma( "example.cs",100 );
// 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可用于表示文件中的特定位置。CodeLinePragma can be used to represent a specific location within a file. 这种类型的对象通常由调试工具在编译后使用, 以存储关联代码元素的位置, 例如与编译器警告和错误关联的位置引用。This type of object is often used after compilation by debugging tools to store locations of associated code elements, such as position references associated with compiler warnings and errors.

构造函数

CodeLinePragma()

初始化 CodeLinePragma 类的新实例。Initializes a new instance of the CodeLinePragma class.

CodeLinePragma(String, Int32)

初始化 CodeLinePragma 类的新实例。Initializes a new instance of the CodeLinePragma class.

属性

FileName

获取或设置关联文件的名称。Gets or sets the name of the associated file.

LineNumber

获取或设置关联引用的行号。Gets or sets the line number of the associated reference.

方法

Equals(Object)

确定指定的对象是否等于当前对象。Determines whether the specified object is equal to the current object.

(继承自 Object)
GetHashCode()

作为默认哈希函数。Serves as the default hash function.

(继承自 Object)
GetType()

获取当前实例的 TypeGets the Type of the current instance.

(继承自 Object)
MemberwiseClone()

创建当前 Object 的浅表副本。Creates a shallow copy of the current Object.

(继承自 Object)
ToString()

返回表示当前对象的字符串。Returns a string that represents the current object.

(继承自 Object)

适用于