CompilerErrorCollection.Insert(Int32, CompilerError) 方法

定義

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

C#
public void Insert (int index, System.CodeDom.Compiler.CompilerError value);

參數

index
Int32

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

value
CompilerError

要插入的 CompilerError

範例

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

C#
// Inserts a CompilerError at index 0 of the collection.
collection.Insert( 0, new CompilerError("Testfile.cs", 5, 10, "CS0001", "Example error text") );

適用於

產品 版本
.NET Framework 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9

另請參閱