Share via


CompilerErrorCollection.Add(CompilerError) メソッド

定義

指定した CompilerError オブジェクトをエラー コレクションに追加します。

public:
 int Add(System::CodeDom::Compiler::CompilerError ^ value);
public int Add (System.CodeDom.Compiler.CompilerError value);
member this.Add : System.CodeDom.Compiler.CompilerError -> int
Public Function Add (value As CompilerError) As Integer

パラメーター

value
CompilerError

追加する CompilerError オブジェクト。

戻り値

新しい要素が挿入された位置のインデックス。

次の例では、 メソッドを使用 Add して オブジェクトを CompilerError に追加する方法を CompilerErrorCollection示します。

// Adds a CompilerError to the collection.
collection->Add( gcnew CompilerError( "Testfile::cs",5,10,"CS0001","Example error text" ) );
// Adds a CompilerError to the collection.
collection.Add( new CompilerError("Testfile.cs", 5, 10, "CS0001", "Example error text") );
' Adds a CompilerError to the collection.
collection.Add(New CompilerError("Testfile.cs", 5, 10, "CS0001", "Example error text"))

適用対象

こちらもご覧ください