CompilerErrorCollection.Insert(Int32, CompilerError) 方法

定義

將指定的 CompilerError 插入至集合中的指定索引處。

public:
 void Insert(int index, System::CodeDom::Compiler::CompilerError ^ value);
public void Insert (int index, System.CodeDom.Compiler.CompilerError value);
member this.Insert : int * System.CodeDom.Compiler.CompilerError -> unit
Public Sub Insert (index As Integer, value As CompilerError)

參數

index
Int32

應將指編譯器錯誤插入處的以零起始索引。

value
CompilerError

要插入的 CompilerError

範例

下列範例示範如何使用 Insert 方法將 物件 CompilerErrorCollection 插入 CompilerError 中。

// Inserts a CompilerError at index 0 of the collection.
collection->Insert( 0, gcnew CompilerError( "Testfile.cs",5,10,"CS0001","Example error text" ) );
// Inserts a CompilerError at index 0 of the collection.
collection.Insert( 0, new CompilerError("Testfile.cs", 5, 10, "CS0001", "Example error text") );
' Inserts a CompilerError at index 0 of the collection.
collection.Insert(0, New CompilerError("Testfile.cs", 5, 10, "CS0001", "Example error text"))

適用於

另請參閱