CounterCreationDataCollection CounterCreationDataCollection CounterCreationDataCollection CounterCreationDataCollection Class

定義

CounterCreationData オブジェクトの厳密に型指定されたコレクションを提供します。Provides a strongly typed collection of CounterCreationData objects.

public ref class CounterCreationDataCollection : System::Collections::CollectionBase
[System.Serializable]
public class CounterCreationDataCollection : System.Collections.CollectionBase
type CounterCreationDataCollection = class
    inherit CollectionBase
Public Class CounterCreationDataCollection
Inherits CollectionBase
継承
CounterCreationDataCollectionCounterCreationDataCollectionCounterCreationDataCollectionCounterCreationDataCollection
属性

CounterCreationDataCollection クラスを使用する方法を次の例に示します。The following example demonstrates how to use the CounterCreationDataCollection class. この例では、クラスの新しいインスタンスを作成し、いくつかのメソッドを使用して、コレクションにステートメントを追加し、そのインデックスを返し、特定のインデックスポイントで属性を追加または削除します。The example creates a new instance of the class and uses several methods to add statements to the collection, return their index, and add or remove attributes at a specific index point.

#using <System.dll>

using namespace System;
using namespace System::Collections;
using namespace System::Collections::Specialized;
using namespace System::Diagnostics;

// Output information about the counter sample.
void OutputSample( CounterSample s )
{
   Console::WriteLine( "\r\n+++++++++++" );
   Console::WriteLine( "Sample values - \r\n" );
   Console::WriteLine( "   BaseValue        = {0}", s.BaseValue );
   Console::WriteLine( "   CounterFrequency = {0}", s.CounterFrequency );
   Console::WriteLine( "   CounterTimeStamp = {0}", s.CounterTimeStamp );
   Console::WriteLine( "   CounterType      = {0}", s.CounterType );
   Console::WriteLine( "   RawValue         = {0}", s.RawValue );
   Console::WriteLine( "   SystemFrequency  = {0}", s.SystemFrequency );
   Console::WriteLine( "   TimeStamp        = {0}", s.TimeStamp );
   Console::WriteLine( "   TimeStamp100nSec = {0}", s.TimeStamp100nSec );
   Console::WriteLine( "++++++++++++++++++++++" );
}

//++++++++//++++++++//++++++++//++++++++//++++++++//++++++++//++++++++//++++++++
//    Description - This counter type shows how many items are processed, on average,
//        during an operation. Counters of this type display a ratio of the items 
//        processed (such as bytes sent) to the number of operations completed. The  
//        ratio is calculated by comparing the number of items processed during the 
//        last interval to the number of operations completed during the last interval. 
// Generic type - Average
//      Formula - (N1 - N0) / (D1 - D0), where the numerator (N) represents the number 
//        of items processed during the last sample interval and the denominator (D) 
//        represents the number of operations completed during the last two sample 
//        intervals. 
//    Average (Nx - N0) / (Dx - D0)  
//    Example PhysicalDisk\ Avg. Disk Bytes/Transfer 
//++++++++//++++++++//++++++++//++++++++//++++++++//++++++++//++++++++//++++++++
float MyComputeCounterValue( CounterSample s0, CounterSample s1 )
{
   float numerator = (float)s1.RawValue - (float)s0.RawValue;
   float denomenator = (float)s1.BaseValue - (float)s0.BaseValue;
   float counterValue = numerator / denomenator;
   return counterValue;
}

bool SetupCategory()
{
   if (  !PerformanceCounterCategory::Exists( "AverageCounter64SampleCategory" ) )
   {
      CounterCreationDataCollection^ CCDC = gcnew CounterCreationDataCollection;
      
      // Add the counter.
      CounterCreationData^ averageCount64 = gcnew CounterCreationData;
      averageCount64->CounterType = PerformanceCounterType::AverageCount64;
      averageCount64->CounterName = "AverageCounter64Sample";
      CCDC->Add( averageCount64 );
      
      // Add the base counter.
      CounterCreationData^ averageCount64Base = gcnew CounterCreationData;
      averageCount64Base->CounterType = PerformanceCounterType::AverageBase;
      averageCount64Base->CounterName = "AverageCounter64SampleBase";
      CCDC->Add( averageCount64Base );
      
      // Create the category.
      PerformanceCounterCategory::Create( "AverageCounter64SampleCategory", "Demonstrates usage of the AverageCounter64 performance counter type.", CCDC );
      return (true);
   }
   else
   {
      Console::WriteLine( "Category exists - AverageCounter64SampleCategory" );
      return (false);
   }
}

void CreateCounters( PerformanceCounter^% PC, PerformanceCounter^% BPC )
{
   
   // Create the counters.
   PC = gcnew PerformanceCounter( "AverageCounter64SampleCategory","AverageCounter64Sample",false );

   BPC = gcnew PerformanceCounter( "AverageCounter64SampleCategory","AverageCounter64SampleBase",false );
   PC->RawValue = 0;
   BPC->RawValue = 0;
}
void CollectSamples( ArrayList^ samplesList, PerformanceCounter^ PC, PerformanceCounter^ BPC )
{
   Random^ r = gcnew Random( DateTime::Now.Millisecond );

   // Loop for the samples.
   for ( int j = 0; j < 100; j++ )
   {
      int value = r->Next( 1, 10 );
      Console::Write( "{0} = {1}", j, value );
      PC->IncrementBy( value );
      BPC->Increment();
      if ( (j % 10) == 9 )
      {
         OutputSample( PC->NextSample() );
         samplesList->Add( PC->NextSample() );
      }
      else
            Console::WriteLine();
      System::Threading::Thread::Sleep( 50 );
   }
}

void CalculateResults( ArrayList^ samplesList )
{
   for ( int i = 0; i < (samplesList->Count - 1); i++ )
   {
      // Output the sample.
      OutputSample(  *safe_cast<CounterSample^>(samplesList[ i ]) );
      OutputSample(  *safe_cast<CounterSample^>(samplesList[ i + 1 ]) );
      
      // Use .NET to calculate the counter value.
      Console::WriteLine( ".NET computed counter value = {0}", CounterSampleCalculator::ComputeCounterValue(  *safe_cast<CounterSample^>(samplesList[ i ]),  *safe_cast<CounterSample^>(samplesList[ i + 1 ]) ) );
      
      // Calculate the counter value manually.
      Console::WriteLine( "My computed counter value = {0}", MyComputeCounterValue(  *safe_cast<CounterSample^>(samplesList[ i ]),  *safe_cast<CounterSample^>(samplesList[ i + 1 ]) ) );
   }
}

int main()
{
   ArrayList^ samplesList = gcnew ArrayList;
   PerformanceCounter^ PC;
   PerformanceCounter^ BPC;
   SetupCategory();
   CreateCounters( PC, BPC );
   CollectSamples( samplesList, PC, BPC );
   CalculateResults( samplesList );
}

using System;
using System.Collections;
using System.Collections.Specialized;
using System.Diagnostics;

public class App {

    private static PerformanceCounter avgCounter64Sample;
    private static PerformanceCounter avgCounter64SampleBase;

    public static void Main()
    {
    
        ArrayList samplesList = new ArrayList();

        // If the category does not exist, create the category and exit.
        // Performance counters should not be created and immediately used.
        // There is a latency time to enable the counters, they should be created
        // prior to executing the application that uses the counters.
        // Execute this sample a second time to use the category.
        if (SetupCategory())
            return;
        CreateCounters();
        CollectSamples(samplesList);
        CalculateResults(samplesList);

    }

    private static bool SetupCategory()
    {
        if ( !PerformanceCounterCategory.Exists("AverageCounter64SampleCategory") ) 
        {

            CounterCreationDataCollection counterDataCollection = new CounterCreationDataCollection();

            // Add the counter.
            CounterCreationData averageCount64 = new CounterCreationData();
            averageCount64.CounterType = PerformanceCounterType.AverageCount64;
            averageCount64.CounterName = "AverageCounter64Sample";
            counterDataCollection.Add(averageCount64);

            // Add the base counter.
            CounterCreationData averageCount64Base = new CounterCreationData();
            averageCount64Base.CounterType = PerformanceCounterType.AverageBase;
            averageCount64Base.CounterName = "AverageCounter64SampleBase";
            counterDataCollection.Add(averageCount64Base);

            // Create the category.
            PerformanceCounterCategory.Create("AverageCounter64SampleCategory",
                "Demonstrates usage of the AverageCounter64 performance counter type.",
                PerformanceCounterCategoryType.SingleInstance, counterDataCollection);

            return(true);
        }
        else
        {
            Console.WriteLine("Category exists - AverageCounter64SampleCategory");
            return(false);
        }
    }

    private static void CreateCounters()
    {
        // Create the counters.

        avgCounter64Sample = new PerformanceCounter("AverageCounter64SampleCategory", 
            "AverageCounter64Sample", 
            false);


        avgCounter64SampleBase = new PerformanceCounter("AverageCounter64SampleCategory", 
            "AverageCounter64SampleBase", 
            false);

        avgCounter64Sample.RawValue=0;
        avgCounter64SampleBase.RawValue=0;
    }
    private static void CollectSamples(ArrayList samplesList)
    {

        Random r = new Random( DateTime.Now.Millisecond );

        // Loop for the samples.
        for (int j = 0; j < 100; j++) 
        {

            int value = r.Next(1, 10);
            Console.Write(j + " = " + value);

            avgCounter64Sample.IncrementBy(value);

            avgCounter64SampleBase.Increment();

            if ((j % 10) == 9) 
            {
                OutputSample(avgCounter64Sample.NextSample());
                samplesList.Add( avgCounter64Sample.NextSample() );
            }
            else
                Console.WriteLine();

            System.Threading.Thread.Sleep(50);
        }

    }

    private static void CalculateResults(ArrayList samplesList)
    {
        for(int i = 0; i < (samplesList.Count - 1); i++)
        {
            // Output the sample.
            OutputSample( (CounterSample)samplesList[i] );
            OutputSample( (CounterSample)samplesList[i+1] );

            // Use .NET to calculate the counter value.
            Console.WriteLine(".NET computed counter value = " +
                CounterSampleCalculator.ComputeCounterValue((CounterSample)samplesList[i],
                (CounterSample)samplesList[i+1]) );

            // Calculate the counter value manually.
            Console.WriteLine("My computed counter value = " + 
                MyComputeCounterValue((CounterSample)samplesList[i],
                (CounterSample)samplesList[i+1]) );

        }
    }

    //++++++++//++++++++//++++++++//++++++++//++++++++//++++++++//++++++++//++++++++
    //    Description - This counter type shows how many items are processed, on average,
    //        during an operation. Counters of this type display a ratio of the items 
    //        processed (such as bytes sent) to the number of operations completed. The  
    //        ratio is calculated by comparing the number of items processed during the 
    //        last interval to the number of operations completed during the last interval. 
    // Generic type - Average
    //      Formula - (N1 - N0) / (D1 - D0), where the numerator (N) represents the number 
    //        of items processed during the last sample interval and the denominator (D) 
    //        represents the number of operations completed during the last two sample 
    //        intervals. 
    //    Average (Nx - N0) / (Dx - D0)  
    //    Example PhysicalDisk\ Avg. Disk Bytes/Transfer 
    //++++++++//++++++++//++++++++//++++++++//++++++++//++++++++//++++++++//++++++++
    private static Single MyComputeCounterValue(CounterSample s0, CounterSample s1)
    {
        Single numerator = (Single)s1.RawValue - (Single)s0.RawValue;
        Single denomenator = (Single)s1.BaseValue - (Single)s0.BaseValue;
        Single counterValue = numerator / denomenator;
        return(counterValue);
    }

    // Output information about the counter sample.
    private static void OutputSample(CounterSample s)
    {
        Console.WriteLine("\r\n+++++++++++");
        Console.WriteLine("Sample values - \r\n");
        Console.WriteLine("   BaseValue        = " + s.BaseValue);
        Console.WriteLine("   CounterFrequency = " + s.CounterFrequency);
        Console.WriteLine("   CounterTimeStamp = " + s.CounterTimeStamp);
        Console.WriteLine("   CounterType      = " + s.CounterType);
        Console.WriteLine("   RawValue         = " + s.RawValue);
        Console.WriteLine("   SystemFrequency  = " + s.SystemFrequency);
        Console.WriteLine("   TimeStamp        = " + s.TimeStamp);
        Console.WriteLine("   TimeStamp100nSec = " + s.TimeStamp100nSec);
        Console.WriteLine("++++++++++++++++++++++");
    }
}
Imports System.Collections
Imports System.Collections.Specialized
Imports System.Diagnostics

 _

Public Class App

    Private Shared avgCounter64Sample As PerformanceCounter
    Private Shared avgCounter64SampleBase As PerformanceCounter


    Public Shared Sub Main()

        Dim samplesList As New ArrayList()
        'If the category does not exist, create the category and exit.
        'Performance counters should not be created and immediately used.
        'There is a latency time to enable the counters, they should be created
        'prior to executing the application that uses the counters.
        'Execute this sample a second time to use the counters.
        If Not (SetupCategory()) Then
            CreateCounters()
            CollectSamples(samplesList)
            CalculateResults(samplesList)
        End If

    End Sub

    Private Shared Function SetupCategory() As Boolean
        If Not PerformanceCounterCategory.Exists("AverageCounter64SampleCategory") Then

            Dim counterDataCollection As New CounterCreationDataCollection()

            ' Add the counter.
            Dim averageCount64 As New CounterCreationData()
            averageCount64.CounterType = PerformanceCounterType.AverageCount64
            averageCount64.CounterName = "AverageCounter64Sample"
            counterDataCollection.Add(averageCount64)

            ' Add the base counter.
            Dim averageCount64Base As New CounterCreationData()
            averageCount64Base.CounterType = PerformanceCounterType.AverageBase
            averageCount64Base.CounterName = "AverageCounter64SampleBase"
            counterDataCollection.Add(averageCount64Base)

            ' Create the category.
            PerformanceCounterCategory.Create("AverageCounter64SampleCategory", _
               "Demonstrates usage of the AverageCounter64 performance counter type.", _
                      PerformanceCounterCategoryType.SingleInstance, counterDataCollection)

            Return True
        Else
            Console.WriteLine("Category exists - AverageCounter64SampleCategory")
            Return False
        End If
    End Function 'SetupCategory

    Private Shared Sub CreateCounters()
        ' Create the counters.

        avgCounter64Sample = New PerformanceCounter("AverageCounter64SampleCategory", "AverageCounter64Sample", False)

        avgCounter64SampleBase = New PerformanceCounter("AverageCounter64SampleCategory", "AverageCounter64SampleBase", False)

        avgCounter64Sample.RawValue = 0
        avgCounter64SampleBase.RawValue = 0
    End Sub

    Private Shared Sub CollectSamples(ByVal samplesList As ArrayList)

        Dim r As New Random(DateTime.Now.Millisecond)

        ' Loop for the samples.
        Dim j As Integer
        For j = 0 To 99

            Dim value As Integer = r.Next(1, 10)
            Console.Write(j.ToString() + " = " + value.ToString())

            avgCounter64Sample.IncrementBy(value)

            avgCounter64SampleBase.Increment()

            If j Mod 10 = 9 Then
                OutputSample(avgCounter64Sample.NextSample())
                samplesList.Add(avgCounter64Sample.NextSample())
            Else
                Console.WriteLine()
            End If
            System.Threading.Thread.Sleep(50)
        Next j
    End Sub

    Private Shared Sub CalculateResults(ByVal samplesList As ArrayList)
        Dim i As Integer
        For i = 0 To (samplesList.Count - 1) - 1
            ' Output the sample.
            OutputSample(CType(samplesList(i), CounterSample))
            OutputSample(CType(samplesList((i + 1)), CounterSample))

            ' Use .NET to calculate the counter value.
            Console.WriteLine(".NET computed counter value = " + CounterSampleCalculator.ComputeCounterValue(CType(samplesList(i), CounterSample), CType(samplesList((i + 1)), CounterSample)).ToString())

            ' Calculate the counter value manually.
            Console.WriteLine("My computed counter value = " + MyComputeCounterValue(CType(samplesList(i), CounterSample), CType(samplesList((i + 1)), CounterSample)).ToString())
        Next i
    End Sub

    '++++++++//++++++++//++++++++//++++++++//++++++++//++++++++//++++++++//++++++++
    '	Description - This counter type shows how many items are processed, on average,
    '		during an operation. Counters of this type display a ratio of the items 
    '		processed (such as bytes sent) to the number of operations completed. The  
    '		ratio is calculated by comparing the number of items processed during the 
    '		last interval to the number of operations completed during the last interval. 
    ' Generic type - Average
    '  	Formula - (N1 - N0) / (D1 - D0), where the numerator (N) represents the number 
    '		of items processed during the last sample interval and the denominator (D) 
    '		represents the number of operations completed during the last two sample 
    '		intervals. 
    '	Average (Nx - N0) / (Dx - D0)  
    '	Example PhysicalDisk\ Avg. Disk Bytes/Transfer 
    '++++++++//++++++++//++++++++//++++++++//++++++++//++++++++//++++++++//++++++++
    Private Shared Function MyComputeCounterValue(ByVal s0 As CounterSample, ByVal s1 As CounterSample) As [Single]
        Dim numerator As [Single] = CType(s1.RawValue, [Single]) - CType(s0.RawValue, [Single])
        Dim denomenator As [Single] = CType(s1.BaseValue, [Single]) - CType(s0.BaseValue, [Single])
        Dim counterValue As [Single] = numerator / denomenator
        Return counterValue
    End Function 'MyComputeCounterValue

    ' Output information about the counter sample.
    Private Shared Sub OutputSample(ByVal s As CounterSample)
        Console.WriteLine(ControlChars.Lf + ControlChars.Cr + "+++++++++++")
        Console.WriteLine("Sample values - " + ControlChars.Lf + ControlChars.Cr)
        Console.WriteLine(("   BaseValue        = " + s.BaseValue.ToString()))
        Console.WriteLine(("   CounterFrequency = " + s.CounterFrequency.ToString()))
        Console.WriteLine(("   CounterTimeStamp = " + s.CounterTimeStamp.ToString()))
        Console.WriteLine(("   CounterType      = " + s.CounterType.ToString()))
        Console.WriteLine(("   RawValue         = " + s.RawValue.ToString()))
        Console.WriteLine(("   SystemFrequency  = " + s.SystemFrequency.ToString()))
        Console.WriteLine(("   TimeStamp        = " + s.TimeStamp.ToString()))
        Console.WriteLine(("   TimeStamp100nSec = " + s.TimeStamp100nSec.ToString()))
        Console.WriteLine("++++++++++++++++++++++")
    End Sub
End Class 'App

コンストラクター

CounterCreationDataCollection() CounterCreationDataCollection() CounterCreationDataCollection() CounterCreationDataCollection()

CounterCreationDataCollection インスタンスに関連付けずに、CounterCreationData クラスの新しいインスタンスを初期化します。Initializes a new instance of the CounterCreationDataCollection class, with no associated CounterCreationData instances.

CounterCreationDataCollection(CounterCreationDataCollection) CounterCreationDataCollection(CounterCreationDataCollection) CounterCreationDataCollection(CounterCreationDataCollection) CounterCreationDataCollection(CounterCreationDataCollection)

CounterCreationDataCollection のインスタンスのコレクションを指定して、CounterCreationData クラスの新しいインスタンスを初期化します。Initializes a new instance of the CounterCreationDataCollection class by using the specified collection of CounterCreationData instances.

CounterCreationDataCollection(CounterCreationData[]) CounterCreationDataCollection(CounterCreationData[]) CounterCreationDataCollection(CounterCreationData[]) CounterCreationDataCollection(CounterCreationData[])

CounterCreationDataCollection インスタンスの配列を指定して、CounterCreationData クラスの新しいインスタンスを初期化します。Initializes a new instance of the CounterCreationDataCollection class by using the specified array of CounterCreationData instances.

プロパティ

Capacity Capacity Capacity Capacity

CollectionBase に格納できる要素の数を取得または設定します。Gets or sets the number of elements that the CollectionBase can contain.

(Inherited from CollectionBase)
Count Count Count Count

CollectionBase インスタンスに格納されている要素の数を取得します。Gets the number of elements contained in the CollectionBase instance. このプロパティはオーバーライドできません。This property cannot be overridden.

(Inherited from CollectionBase)
ICollection.IsSynchronized ICollection.IsSynchronized ICollection.IsSynchronized ICollection.IsSynchronized

CollectionBase へのアクセスが同期されている (スレッド セーフである) かどうかを示す値を取得します。Gets a value indicating whether access to the CollectionBase is synchronized (thread safe).

(Inherited from CollectionBase)
ICollection.SyncRoot ICollection.SyncRoot ICollection.SyncRoot ICollection.SyncRoot

CollectionBase へのアクセスを同期するために使用できるオブジェクトを取得します。Gets an object that can be used to synchronize access to the CollectionBase.

(Inherited from CollectionBase)
IList.IsFixedSize IList.IsFixedSize IList.IsFixedSize IList.IsFixedSize

CollectionBase が固定サイズかどうかを示す値を取得します。Gets a value indicating whether the CollectionBase has a fixed size.

(Inherited from CollectionBase)
IList.IsReadOnly IList.IsReadOnly IList.IsReadOnly IList.IsReadOnly

CollectionBase が読み取り専用かどうかを示す値を取得します。Gets a value indicating whether the CollectionBase is read-only.

(Inherited from CollectionBase)
IList.Item[Int32] IList.Item[Int32] IList.Item[Int32] IList.Item[Int32]

指定したインデックスにある要素を取得または設定します。Gets or sets the element at the specified index.

(Inherited from CollectionBase)
InnerList InnerList InnerList InnerList

ArrayList インスタンス内の要素のリストを格納する CollectionBase を取得します。Gets an ArrayList containing the list of elements in the CollectionBase instance.

(Inherited from CollectionBase)
Item[Int32] Item[Int32] Item[Int32] Item[Int32]

CounterCreationData コレクションのインデックスを作成します。Indexes the CounterCreationData collection.

List List List List

IList インスタンス内の要素のリストを格納する CollectionBase を取得します。Gets an IList containing the list of elements in the CollectionBase instance.

(Inherited from CollectionBase)

メソッド

Add(CounterCreationData) Add(CounterCreationData) Add(CounterCreationData) Add(CounterCreationData)

コレクションに CounterCreationData クラスのインスタンスを追加します。Adds an instance of the CounterCreationData class to the collection.

AddRange(CounterCreationDataCollection) AddRange(CounterCreationDataCollection) AddRange(CounterCreationDataCollection) AddRange(CounterCreationDataCollection)

指定された CounterCreationData インスタンスのコレクションをコレクションに追加します。Adds the specified collection of CounterCreationData instances to the collection.

AddRange(CounterCreationData[]) AddRange(CounterCreationData[]) AddRange(CounterCreationData[]) AddRange(CounterCreationData[])

指定された CounterCreationData インスタンスの配列をコレクションに追加します。Adds the specified array of CounterCreationData instances to the collection.

Clear() Clear() Clear() Clear()

CollectionBase インスタンスからすべてのオブジェクトを削除します。Removes all objects from the CollectionBase instance. このメソッドはオーバーライドできません。This method cannot be overridden.

(Inherited from CollectionBase)
Contains(CounterCreationData) Contains(CounterCreationData) Contains(CounterCreationData) Contains(CounterCreationData)

CounterCreationData インスタンスがコレクションにあるかどうかを判断します。Determines whether a CounterCreationData instance exists in the collection.

CopyTo(CounterCreationData[], Int32) CopyTo(CounterCreationData[], Int32) CopyTo(CounterCreationData[], Int32) CopyTo(CounterCreationData[], Int32)

CounterCreationData の要素を array にコピーします。コピーは、array 内の指定したインデックス位置から開始されます。Copies the elements of the CounterCreationData to an array, starting at the specified index of the array.

Equals(Object) Equals(Object) Equals(Object) Equals(Object)

指定したオブジェクトが、現在のオブジェクトと等しいかどうかを判断します。Determines whether the specified object is equal to the current object.

(Inherited from Object)
GetEnumerator() GetEnumerator() GetEnumerator() GetEnumerator()

CollectionBase インスタンスを反復処理する列挙子を返します。Returns an enumerator that iterates through the CollectionBase instance.

(Inherited from CollectionBase)
GetHashCode() GetHashCode() GetHashCode() GetHashCode()

既定のハッシュ関数として機能します。Serves as the default hash function.

(Inherited from Object)
GetType() GetType() GetType() GetType()

現在のインスタンスの Type を取得します。Gets the Type of the current instance.

(Inherited from Object)
IndexOf(CounterCreationData) IndexOf(CounterCreationData) IndexOf(CounterCreationData) IndexOf(CounterCreationData)

コレクション内の CounterCreationData オブジェクトのインデックスを返します。Returns the index of a CounterCreationData object in the collection.

Insert(Int32, CounterCreationData) Insert(Int32, CounterCreationData) Insert(Int32, CounterCreationData) Insert(Int32, CounterCreationData)

コレクション内の指定したインデックス位置に、CounterCreationData オブジェクトを挿入します。Inserts a CounterCreationData object into the collection, at the specified index.

MemberwiseClone() MemberwiseClone() MemberwiseClone() MemberwiseClone()

現在の Object の簡易コピーを作成します。Creates a shallow copy of the current Object.

(Inherited from Object)
OnClear() OnClear() OnClear() OnClear()

CollectionBase インスタンスの内容を消去しているときに、追加のカスタム プロセスを実行します。Performs additional custom processes when clearing the contents of the CollectionBase instance.

(Inherited from CollectionBase)
OnClearComplete() OnClearComplete() OnClearComplete() OnClearComplete()

CollectionBase インスタンスの内容を消去した後に、追加のカスタム プロセスを実行します。Performs additional custom processes after clearing the contents of the CollectionBase instance.

(Inherited from CollectionBase)
OnInsert(Int32, Object) OnInsert(Int32, Object) OnInsert(Int32, Object) OnInsert(Int32, Object)

コレクションに新しいデータ エントリが挿入される前に、追加のカスタム プロセスを実行します。Performs additional custom processes before a new data entry is inserted into the collection.

OnInsertComplete(Int32, Object) OnInsertComplete(Int32, Object) OnInsertComplete(Int32, Object) OnInsertComplete(Int32, Object)

CollectionBase インスタンスに新しい要素を挿入した後に、追加のカスタム プロセスを実行します。Performs additional custom processes after inserting a new element into the CollectionBase instance.

(Inherited from CollectionBase)
OnRemove(Int32, Object) OnRemove(Int32, Object) OnRemove(Int32, Object) OnRemove(Int32, Object)

CollectionBase インスタンスから要素を削除するときに、追加のカスタム プロセスを実行します。Performs additional custom processes when removing an element from the CollectionBase instance.

(Inherited from CollectionBase)
OnRemoveComplete(Int32, Object) OnRemoveComplete(Int32, Object) OnRemoveComplete(Int32, Object) OnRemoveComplete(Int32, Object)

CollectionBase インスタンスから要素を削除した後に、追加のカスタム プロセスを実行します。Performs additional custom processes after removing an element from the CollectionBase instance.

(Inherited from CollectionBase)
OnSet(Int32, Object, Object) OnSet(Int32, Object, Object) OnSet(Int32, Object, Object) OnSet(Int32, Object, Object)

CollectionBase インスタンスに値を設定する前に、追加のカスタム プロセスを実行します。Performs additional custom processes before setting a value in the CollectionBase instance.

(Inherited from CollectionBase)
OnSetComplete(Int32, Object, Object) OnSetComplete(Int32, Object, Object) OnSetComplete(Int32, Object, Object) OnSetComplete(Int32, Object, Object)

CollectionBase インスタンスに値を設定した後に、追加のカスタム プロセスを実行します。Performs additional custom processes after setting a value in the CollectionBase instance.

(Inherited from CollectionBase)
OnValidate(Object) OnValidate(Object) OnValidate(Object) OnValidate(Object)

指定されたオブジェクトをチェックして、有効な CounterCreationData 型であるかどうかを決定します。Checks the specified object to determine whether it is a valid CounterCreationData type.

Remove(CounterCreationData) Remove(CounterCreationData) Remove(CounterCreationData) Remove(CounterCreationData)

CounterCreationData オブジェクトをコレクションから削除します。Removes a CounterCreationData object from the collection.

RemoveAt(Int32) RemoveAt(Int32) RemoveAt(Int32) RemoveAt(Int32)

CollectionBase インスタンスの指定したインデックスにある要素を削除します。Removes the element at the specified index of the CollectionBase instance. このメソッドはオーバーライドできません。This method is not overridable.

(Inherited from CollectionBase)
ToString() ToString() ToString() ToString()

現在のオブジェクトを表す文字列を返します。Returns a string that represents the current object.

(Inherited from Object)

明示的なインターフェイスの実装

ICollection.CopyTo(Array, Int32) ICollection.CopyTo(Array, Int32) ICollection.CopyTo(Array, Int32) ICollection.CopyTo(Array, Int32)

CollectionBase 全体を、互換性のある 1 次元の Array にコピーします。コピー操作は、コピー先の配列の指定したインデックスから始まる部分に行います。Copies the entire CollectionBase to a compatible one-dimensional Array, starting at the specified index of the target array.

(Inherited from CollectionBase)
IList.Add(Object) IList.Add(Object) IList.Add(Object) IList.Add(Object)

CollectionBase の末尾にオブジェクトを追加します。Adds an object to the end of the CollectionBase.

(Inherited from CollectionBase)
IList.Contains(Object) IList.Contains(Object) IList.Contains(Object) IList.Contains(Object)

CollectionBase に特定の要素が格納されているかどうかを判断します。Determines whether the CollectionBase contains a specific element.

(Inherited from CollectionBase)
IList.IndexOf(Object) IList.IndexOf(Object) IList.IndexOf(Object) IList.IndexOf(Object)

指定した Object を検索し、CollectionBase 全体内で最初に見つかった位置の 0 から始まるインデックスを返します。Searches for the specified Object and returns the zero-based index of the first occurrence within the entire CollectionBase.

(Inherited from CollectionBase)
IList.Insert(Int32, Object) IList.Insert(Int32, Object) IList.Insert(Int32, Object) IList.Insert(Int32, Object)

CollectionBase 内の指定したインデックスの位置に要素を挿入します。Inserts an element into the CollectionBase at the specified index.

(Inherited from CollectionBase)
IList.Remove(Object) IList.Remove(Object) IList.Remove(Object) IList.Remove(Object)

特定のオブジェクトが CollectionBase 内にあるときに、最初に出現したものを削除します。Removes the first occurrence of a specific object from the CollectionBase.

(Inherited from CollectionBase)

拡張メソッド

Cast<TResult>(IEnumerable) Cast<TResult>(IEnumerable) Cast<TResult>(IEnumerable) Cast<TResult>(IEnumerable)

IEnumerable の要素を、指定した型にキャストします。Casts the elements of an IEnumerable to the specified type.

OfType<TResult>(IEnumerable) OfType<TResult>(IEnumerable) OfType<TResult>(IEnumerable) OfType<TResult>(IEnumerable)

指定された型に基づいて IEnumerable の要素をフィルター処理します。Filters the elements of an IEnumerable based on a specified type.

AsParallel(IEnumerable) AsParallel(IEnumerable) AsParallel(IEnumerable) AsParallel(IEnumerable)

クエリの並列化を有効にします。Enables parallelization of a query.

AsQueryable(IEnumerable) AsQueryable(IEnumerable) AsQueryable(IEnumerable) AsQueryable(IEnumerable)

IEnumerableIQueryable に変換します。Converts an IEnumerable to an IQueryable.

適用対象