CompilerErrorCollection クラスとは? わかりやすく解説

Weblio 辞書 > コンピュータ > .NET Framework クラス ライブラリ リファレンス > CompilerErrorCollection クラスの意味・解説 

CompilerErrorCollection クラス

CompilerError オブジェクトコレクション表します

名前空間: System.CodeDom.Compiler
アセンブリ: System (system.dll 内)
構文構文

<SerializableAttribute> _
Public Class CompilerErrorCollection
    Inherits CollectionBase
Dim instance As CompilerErrorCollection
[SerializableAttribute] 
public class CompilerErrorCollection : CollectionBase
[SerializableAttribute] 
public ref class CompilerErrorCollection :
 public CollectionBase
/** @attribute SerializableAttribute() */ 
public class CompilerErrorCollection extends
 CollectionBase
SerializableAttribute 
public class CompilerErrorCollection extends
 CollectionBase
解説解説
使用例使用例
' Creates an empty CompilerErrorCollection.
Dim collection As New CompilerErrorCollection()

' Adds a CompilerError to the collection.
collection.Add(New CompilerError("Testfile.cs",
 5, 10, "CS0001", "Example error
 text"))

' Adds an array of CompilerError objects to the collection.
Dim errors As CompilerError() = {New CompilerError("Testfile.cs",
 5, 10, "CS0001", "Example error
 text"), New CompilerError("Testfile.cs", 5, 10, "CS0001", "Example error text")}
collection.AddRange(errors)

' Adds a collection of CompilerError objects to the collection.
Dim errorsCollection As New
 CompilerErrorCollection()
errorsCollection.Add(New CompilerError("Testfile.cs",
 5, 10, "CS0001", "Example error
 text"))
errorsCollection.Add(New CompilerError("Testfile.cs",
 5, 10, "CS0001", "Example error
 text"))
collection.AddRange(errorsCollection)

' Tests for the presence of a CompilerError in the 
' collection, and retrieves its index if it is found.
Dim testError As New CompilerError("Testfile.cs",
 5, 10, "CS0001", "Example error
 text")
Dim itemIndex As Integer
 = -1
If collection.Contains(testError) Then
    itemIndex = collection.IndexOf(testError)
End If

' Copies the contents of the collection, beginning at index 0, 
' to the specified CompilerError array.
' 'errors' is a CompilerError array.
collection.CopyTo(errors, 0)

' Retrieves the count of the items in the collection.
Dim collectionCount As Integer
 = collection.Count

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

' Removes the specified CompilerError from the collection.
Dim [error] As New CompilerError("Testfile.cs",
 5, 10, "CS0001", "Example error
 text")
collection.Remove([error])

' Removes the CompilerError at index 0.
collection.RemoveAt(0)
// Creates an empty CompilerErrorCollection.
CompilerErrorCollection collection = new CompilerErrorCollection();
                        

// Adds a CompilerError to the collection.
collection.Add( new CompilerError("Testfile.cs", 5,
 10, "CS0001", "Example error text") );

// Adds an array of CompilerError objects to the collection.
CompilerError[] errors = { new CompilerError("Testfile.cs",
 5, 10, "CS0001", "Example error text"), new
 CompilerError("Testfile.cs", 5, 10, "CS0001", "Example error text") };
collection.AddRange( errors );

// Adds a collection of CompilerError objects to the collection.
CompilerErrorCollection errorsCollection = new CompilerErrorCollection();
errorsCollection.Add( new CompilerError("Testfile.cs",
 5, 10, "CS0001", "Example error text") );
errorsCollection.Add( new CompilerError("Testfile.cs",
 5, 10, "CS0001", "Example error text") );
collection.AddRange( errorsCollection );

// Tests for the presence of a CompilerError in the 
// collection, and retrieves its index if it is found.
CompilerError testError = new CompilerError("Testfile.cs",
 5, 10, "CS0001", "Example error text");
int itemIndex = -1;
if( collection.Contains( testError ) )
    itemIndex = collection.IndexOf( testError );

// Copies the contents of the collection, beginning at index 0, 
// to the specified CompilerError array.
// 'errors' is a CompilerError array.
collection.CopyTo( errors, 0 );

// Retrieves the count of the items in the collection.
int collectionCount = collection.Count;

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

// Removes the specified CompilerError from the collection.
CompilerError error = new CompilerError("Testfile.cs",
 5, 10, "CS0001", "Example error text");
collection.Remove( error );

// Removes the CompilerError at index 0.
collection.RemoveAt(0);
// Creates an empty CompilerErrorCollection.
CompilerErrorCollection^ collection = gcnew CompilerErrorCollection;

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

// Adds an array of CompilerError objects to the collection.
array<CompilerError^>^errors = {gcnew CompilerError( "Testfile.cs",5,10,"CS0001","Example
 error text" ),gcnew CompilerError( "Testfile::cs",5,10,"CS0001","Example
 error text" )};
collection->AddRange( errors );

// Adds a collection of CompilerError objects to the collection.
CompilerErrorCollection^ errorsCollection = gcnew CompilerErrorCollection;
errorsCollection->Add( gcnew CompilerError( "Testfile.cs",5,10,"CS0001","Example
 error text" ) );
errorsCollection->Add( gcnew CompilerError( "Testfile.cs",5,10,"CS0001","Example
 error text" ) );
collection->AddRange( errorsCollection );

// Tests for the presence of a CompilerError in the
// collection, and retrieves its index if it is found.
CompilerError^ testError = gcnew CompilerError( "Testfile.cs",5,10,"CS0001","Example
 error text" );
int itemIndex = -1;
if ( collection->Contains( testError ) )
   itemIndex = collection->IndexOf( testError );

// Copies the contents of the collection, beginning at index 0,
// to the specified CompilerError array.
// 'errors' is a CompilerError array.
collection->CopyTo( errors, 0 );

// Retrieves the count of the items in the collection.
int collectionCount = collection->Count;

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

// Removes the specified CompilerError from the collection.
CompilerError^ error = gcnew CompilerError( "Testfile.cs",5,10,"CS0001","Example
 error text" );
collection->Remove( error );

// Removes the CompilerError at index 0.
collection->RemoveAt( 0 );
// Creates an empty CompilerErrorCollection.
CompilerErrorCollection collection = new CompilerErrorCollection();

// Adds a CompilerError to the collection.
collection.Add(new CompilerError("Testfile.cs", 5, 10,
 "CS0001", 
    "Example error text"));

// Adds an array of CompilerError objects to the collection.
CompilerError errors[] =  { new CompilerError("Testfile.cs",
 5, 10, 
    "CS0001", "Example error text"), new CompilerError("Testfile.jsl",
 5,
    10, "CS0001", "Example error text") };
collection.AddRange(errors);
// Adds a collection of CompilerError objects to the collection.
CompilerErrorCollection errorsCollection = new CompilerErrorCollection();
errorsCollection.Add(new CompilerError("Testfile.jsl",
 5, 10, "CS0001",
    "Example error text"));
errorsCollection.Add(new CompilerError("Testfile.jsl",
 5, 10, "JSL0001",
    "Example error text"));
collection.AddRange(errorsCollection);

// Tests for the presence of a CompilerError in the 
// collection, and retrieves its index if it is found.
CompilerError testError = new CompilerError("Testfile.JSL",
 5, 10,
    "JSL0001", "Example error text");
int itemIndex = -1;
if (collection.Contains(testError)) {
    itemIndex = collection.IndexOf(testError);
}

// Copies the contents of the collection, beginning at index 0, 
// to the specified CompilerError array.
// 'errors' is a CompilerError array.
collection.CopyTo(errors, 0);

// Retrieves the count of the items in the collection.
int collectionCount = collection.get_Count();

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

// Removes the specified CompilerError from the collection.
CompilerError error = new CompilerError("Testfile.cs",
 5, 10, "JSL0001",
    "Example error text");
collection.Remove(error);

// Removes the CompilerError at index 0.
collection.RemoveAt(0);
.NET Framework のセキュリティ.NET Frameworkセキュリティ
継承階層継承階層
System.Object
   System.Collections.CollectionBase
    System.CodeDom.Compiler.CompilerErrorCollection
スレッド セーフスレッド セーフ
この型の public static (Visual Basic では Shared) メンバはすべて、スレッド セーフです。インスタンス メンバ場合は、スレッド セーフであるとは限りません。
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
CompilerErrorCollection メンバ
System.CodeDom.Compiler 名前空間
CompilerErrorCollection クラス



英和和英テキスト翻訳>> Weblio翻訳
英語⇒日本語日本語⇒英語
  

辞書ショートカット

すべての辞書の索引

「CompilerErrorCollection クラス」の関連用語

CompilerErrorCollection クラスのお隣キーワード
検索ランキング

   

英語⇒日本語
日本語⇒英語
   



CompilerErrorCollection クラスのページの著作権
Weblio 辞書 情報提供元は 参加元一覧 にて確認できます。

   
日本マイクロソフト株式会社日本マイクロソフト株式会社
© 2025 Microsoft.All rights reserved.

©2025 GRAS Group, Inc.RSS