CounterCreationData コンストラクタとは? わかりやすく解説

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

CounterCreationData コンストラクタ (String, String, PerformanceCounterType)

カウンタ名およびヘルプ文字列指定して、CounterCreationData クラス新しインスタンスを、指定したタイプカウンタ初期化します。

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

Public Sub New ( _
    counterName As String, _
    counterHelp As String, _
    counterType As PerformanceCounterType _
)
Dim counterName As String
Dim counterHelp As String
Dim counterType As PerformanceCounterType

Dim instance As New CounterCreationData(counterName,
 counterHelp, counterType)
public CounterCreationData (
    string counterName,
    string counterHelp,
    PerformanceCounterType counterType
)
public:
CounterCreationData (
    String^ counterName, 
    String^ counterHelp, 
    PerformanceCounterType counterType
)
public CounterCreationData (
    String counterName, 
    String counterHelp, 
    PerformanceCounterType counterType
)
public function CounterCreationData (
    counterName : String, 
    counterHelp : String, 
    counterType : PerformanceCounterType
)

パラメータ

counterName

カウンタ名。カテゴリ内で一意である必要があります

counterHelp

カウンタ動作説明するテキスト

counterType

カウンタ動作識別する PerformanceCounterType。

例外例外
例外種類条件

InvalidEnumArgumentException

指定した counterType の値が PerformanceCounterType 列挙体のメンバではありません。

ArgumentNullException

counterHelpnull 参照 (Visual Basic では Nothing) です。

使用例使用例
Imports System
Imports System.Diagnostics

Namespace MyDiagnostics

   Class MyCounterCreationData
      
      Shared Sub Main()
         Dim myCol As New
 CounterCreationDataCollection()
         
         ' Create two custom counter objects.
         Dim myCounter1 As New
 CounterCreationData("Counter1", "First
 custom counter", _
                                   PerformanceCounterType.CounterDelta32)
         Dim myCounter2 As New
 CounterCreationData()
         
         ' Set the properties of the 'CounterCreationData' object.
         myCounter2.CounterName = "Counter2"
         myCounter2.CounterHelp = "Second custom counter"
         myCounter2.CounterType = PerformanceCounterType.NumberOfItemsHEX32
         
         ' Add custom counter objects to CounterCreationDataCollection.
         myCol.Add(myCounter1)
         myCol.Add(myCounter2)
         
         If PerformanceCounterCategory.Exists("New
 Counter Category") Then
            PerformanceCounterCategory.Delete("New Counter Category")
         End If 
         ' Bind the counters to a PerformanceCounterCategory.
         Dim myCategory As PerformanceCounterCategory
 = PerformanceCounterCategory.Create("New " + _
                                    "Counter Category",
 "Category Help", myCol)

         Console.WriteLine("Counter Information:")
         Console.WriteLine("Category Name: " + myCategory.CategoryName)
         Dim i As Integer
         For i = 0 To myCol.Count - 1
            ' Display the properties of the CounterCreationData objects.
            Console.WriteLine("CounterName : " + myCol(i).CounterName)
            Console.WriteLine("CounterHelp : " + myCol(i).CounterHelp)
            Console.WriteLine("CounterType : " + myCol(i).CounterType.ToString())
         Next i
      End Sub 'Main
   End Class 'MyCounterCreationData
End Namespace 'MyDiagnostics
using System;
using System.Diagnostics;

namespace MyDiagnostics
{
   class MyCounterCreationData
   {
      static void Main()
      {
         CounterCreationDataCollection myCol = 
                                    new CounterCreationDataCollection();

         // Create two custom counter objects.
         CounterCreationData myCounter1 = new CounterCreationData("Counter1"
,
            "First custom counter", PerformanceCounterType.CounterDelta32);

         CounterCreationData myCounter2 = new CounterCreationData();

         // Set the properties of the 'CounterCreationData' object.
         myCounter2.CounterName = "Counter2";
         myCounter2.CounterHelp = "Second custom counter";
         myCounter2.CounterType = PerformanceCounterType.NumberOfItemsHEX32;

         // Add custom counter objects to CounterCreationDataCollection.
         myCol.Add(myCounter1);
         myCol.Add(myCounter2);

         if (PerformanceCounterCategory.Exists("New Counter
 Category"))
            PerformanceCounterCategory.Delete("New Counter Category");

         // Bind the counters to a PerformanceCounterCategory.
         PerformanceCounterCategory myCategory = 
               PerformanceCounterCategory.Create("New Counter Category",
 "Category Help", myCol);

         Console.WriteLine("Counter Information:");
         Console.WriteLine("Category Name: " + myCategory.CategoryName);
         for (int i = 0; i < myCol.Count;
 i++)
         {
            // Display the properties of the CounterCreationData objects.
            Console.WriteLine("CounterName : " + myCol[i].CounterName);
            Console.WriteLine("CounterHelp : " + myCol[i].CounterHelp);
            Console.WriteLine("CounterType : " + myCol[i].CounterType);
         }
      }
   }
}
#using <System.dll>

using namespace System;
using namespace System::Diagnostics;

int main()
{
   CounterCreationDataCollection^ myCol = gcnew CounterCreationDataCollection;
   
   // Create two custom counter objects.
   CounterCreationData^ myCounter1 = gcnew CounterCreationData( "Counter1","First
 custom counter",PerformanceCounterType::CounterDelta32 );
   CounterCreationData^ myCounter2 = gcnew CounterCreationData;
   
   // Set the properties of the 'CounterCreationData' Object*.
   myCounter2->CounterName = "Counter2";
   myCounter2->CounterHelp = "Second custom counter";
   myCounter2->CounterType = PerformanceCounterType::NumberOfItemsHEX32;
   
   // Add custom counter objects to CounterCreationDataCollection.
   myCol->Add( myCounter1 );
   myCol->Add( myCounter2 );
   if ( PerformanceCounterCategory::Exists( "New Counter
 Category" ) )
      PerformanceCounterCategory::Delete( "New Counter Category" );
   
   // Bind the counters to a PerformanceCounterCategory.
   PerformanceCounterCategory^ myCategory = PerformanceCounterCategory::Create( "New
 Counter Category", "Category Help", myCol );
   Console::WriteLine( "Counter Information:" );
   Console::WriteLine( "Category Name: {0}", myCategory->CategoryName
 );
   for ( int i = 0; i < myCol->Count;
 i++ )
   {
      // Display the properties of the CounterCreationData objects.
      Console::WriteLine( "CounterName : {0}", myCol[ i ]->CounterName
 );
      Console::WriteLine( "CounterHelp : {0}", myCol[ i ]->CounterHelp
 );
      Console::WriteLine( "CounterType : {0}", myCol[ i ]->CounterType
 );
   }
}

import System.*;
import System.Diagnostics.*;

class MyCounterCreationData
{
    public static void main(String[]
 args)
    {
        CounterCreationDataCollection myCol = new CounterCreationDataCollection();

        // Create two custom counter objects.
        CounterCreationData myCounter1 = 
            new CounterCreationData("Counter1", "First
 custom counter", 
            PerformanceCounterType.CounterDelta32);

        CounterCreationData myCounter2 = new CounterCreationData();

        // Set the properties of the 'CounterCreationData' object.
        myCounter2.set_CounterName("Counter2");
        myCounter2.set_CounterHelp("Second custom counter");
        myCounter2.set_CounterType(PerformanceCounterType.NumberOfItemsHEX32);

        // Add custom counter objects to CounterCreationDataCollection.
        myCol.Add(myCounter1);
        myCol.Add(myCounter2);
        if (PerformanceCounterCategory.Exists("New Counter
 Category")) {
            PerformanceCounterCategory.Delete("New Counter Category");
        }
        // Bind the counters to a PerformanceCounterCategory.
        PerformanceCounterCategory myCategory = 
            PerformanceCounterCategory.Create("New Counter Category", 
            "Category Help", myCol);

        Console.WriteLine("Counter Information:");
        Console.WriteLine("Category Name: " + myCategory.get_CategoryName());
        for (int i = 0; i < myCol.get_Count();
 i++) {
            // Display the properties of the CounterCreationData objects.
            Console.WriteLine("CounterName : " 
                + myCol.get_Item(i).get_CounterName());
            Console.WriteLine("CounterHelp : " 
                + myCol.get_Item(i).get_CounterHelp());
            Console.WriteLine("CounterType : " 
                + myCol.get_Item(i).get_CounterType());
        }
    } //main
} //MyCounterCreationData
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
CounterCreationData クラス
CounterCreationData メンバ
System.Diagnostics 名前空間
CounterType
CounterName
CounterHelp

CounterCreationData コンストラクタ

CounterCreationData クラス新しインスタンス初期化します。
オーバーロードの一覧オーバーロードの一覧

名前 説明
CounterCreationData () 空の名前およびヘルプ文字列指定してCounterCreationData クラス新しインスタンスNumberOfItems32 タイプカウンタ初期化します。
CounterCreationData (String, String, PerformanceCounterType) カウンタ名およびヘルプ文字列指定してCounterCreationData クラス新しインスタンスを、指定したタイプカウンタ初期化します。
参照参照

関連項目

CounterCreationData クラス
CounterCreationData メンバ
System.Diagnostics 名前空間
CounterType
CounterName
CounterHelp

CounterCreationData コンストラクタ ()

空の名前およびヘルプ文字列指定して、CounterCreationData クラス新しインスタンスNumberOfItems32 タイプカウンタ初期化します。

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

Dim instance As New CounterCreationData
public CounterCreationData ()
public:
CounterCreationData ()
public CounterCreationData ()
public function CounterCreationData ()
使用例使用例
Imports System
Imports System.Diagnostics

Namespace MyDiagnostics

   Class MyCounterCreationData
      
      Shared Sub Main()
         Dim myCol As New
 CounterCreationDataCollection()
         
         ' Create two custom counter objects.
         Dim myCounter1 As New
 CounterCreationData("Counter1", "First
 custom counter", _
                                   PerformanceCounterType.CounterDelta32)
         Dim myCounter2 As New
 CounterCreationData()
         
         ' Set the properties of the 'CounterCreationData' object.
         myCounter2.CounterName = "Counter2"
         myCounter2.CounterHelp = "Second custom counter"
         myCounter2.CounterType = PerformanceCounterType.NumberOfItemsHEX32
         
         ' Add custom counter objects to CounterCreationDataCollection.
         myCol.Add(myCounter1)
         myCol.Add(myCounter2)
         
         If PerformanceCounterCategory.Exists("New
 Counter Category") Then
            PerformanceCounterCategory.Delete("New Counter Category")
         End If 
         ' Bind the counters to a PerformanceCounterCategory.
         Dim myCategory As PerformanceCounterCategory
 = PerformanceCounterCategory.Create("New " + _
                                    "Counter Category",
 "Category Help", myCol)

         Console.WriteLine("Counter Information:")
         Console.WriteLine("Category Name: " + myCategory.CategoryName)
         Dim i As Integer
         For i = 0 To myCol.Count - 1
            ' Display the properties of the CounterCreationData objects.
            Console.WriteLine("CounterName : " + myCol(i).CounterName)
            Console.WriteLine("CounterHelp : " + myCol(i).CounterHelp)
            Console.WriteLine("CounterType : " + myCol(i).CounterType.ToString())
         Next i
      End Sub 'Main
   End Class 'MyCounterCreationData
End Namespace 'MyDiagnostics
using System;
using System.Diagnostics;

namespace MyDiagnostics
{
   class MyCounterCreationData
   {
      static void Main()
      {
         CounterCreationDataCollection myCol = 
                                    new CounterCreationDataCollection();

         // Create two custom counter objects.
         CounterCreationData myCounter1 = new CounterCreationData("Counter1"
,
            "First custom counter", PerformanceCounterType.CounterDelta32);

         CounterCreationData myCounter2 = new CounterCreationData();

         // Set the properties of the 'CounterCreationData' object.
         myCounter2.CounterName = "Counter2";
         myCounter2.CounterHelp = "Second custom counter";
         myCounter2.CounterType = PerformanceCounterType.NumberOfItemsHEX32;

         // Add custom counter objects to CounterCreationDataCollection.
         myCol.Add(myCounter1);
         myCol.Add(myCounter2);

         if (PerformanceCounterCategory.Exists("New Counter
 Category"))
            PerformanceCounterCategory.Delete("New Counter Category");

         // Bind the counters to a PerformanceCounterCategory.
         PerformanceCounterCategory myCategory = 
               PerformanceCounterCategory.Create("New Counter Category",
 "Category Help", myCol);

         Console.WriteLine("Counter Information:");
         Console.WriteLine("Category Name: " + myCategory.CategoryName);
         for (int i = 0; i < myCol.Count;
 i++)
         {
            // Display the properties of the CounterCreationData objects.
            Console.WriteLine("CounterName : " + myCol[i].CounterName);
            Console.WriteLine("CounterHelp : " + myCol[i].CounterHelp);
            Console.WriteLine("CounterType : " + myCol[i].CounterType);
         }
      }
   }
}
#using <System.dll>

using namespace System;
using namespace System::Diagnostics;

int main()
{
   CounterCreationDataCollection^ myCol = gcnew CounterCreationDataCollection;
   
   // Create two custom counter objects.
   CounterCreationData^ myCounter1 = gcnew CounterCreationData( "Counter1","First
 custom counter",PerformanceCounterType::CounterDelta32 );
   CounterCreationData^ myCounter2 = gcnew CounterCreationData;
   
   // Set the properties of the 'CounterCreationData' Object*.
   myCounter2->CounterName = "Counter2";
   myCounter2->CounterHelp = "Second custom counter";
   myCounter2->CounterType = PerformanceCounterType::NumberOfItemsHEX32;
   
   // Add custom counter objects to CounterCreationDataCollection.
   myCol->Add( myCounter1 );
   myCol->Add( myCounter2 );
   if ( PerformanceCounterCategory::Exists( "New Counter
 Category" ) )
      PerformanceCounterCategory::Delete( "New Counter Category" );
   
   // Bind the counters to a PerformanceCounterCategory.
   PerformanceCounterCategory^ myCategory = PerformanceCounterCategory::Create( "New
 Counter Category", "Category Help", myCol );
   Console::WriteLine( "Counter Information:" );
   Console::WriteLine( "Category Name: {0}", myCategory->CategoryName
 );
   for ( int i = 0; i < myCol->Count;
 i++ )
   {
      // Display the properties of the CounterCreationData objects.
      Console::WriteLine( "CounterName : {0}", myCol[ i ]->CounterName
 );
      Console::WriteLine( "CounterHelp : {0}", myCol[ i ]->CounterHelp
 );
      Console::WriteLine( "CounterType : {0}", myCol[ i ]->CounterType
 );
   }
}

import System.*;
import System.Diagnostics.*;

class MyCounterCreationData
{
    public static void main(String[]
 args)
    {
        CounterCreationDataCollection myCol = new CounterCreationDataCollection();

        // Create two custom counter objects.
        CounterCreationData myCounter1 = 
            new CounterCreationData("Counter1", "First
 custom counter", 
            PerformanceCounterType.CounterDelta32);

        CounterCreationData myCounter2 = new CounterCreationData();

        // Set the properties of the 'CounterCreationData' object.
        myCounter2.set_CounterName("Counter2");
        myCounter2.set_CounterHelp("Second custom counter");
        myCounter2.set_CounterType(PerformanceCounterType.NumberOfItemsHEX32);

        // Add custom counter objects to CounterCreationDataCollection.
        myCol.Add(myCounter1);
        myCol.Add(myCounter2);
        if (PerformanceCounterCategory.Exists("New Counter
 Category")) {
            PerformanceCounterCategory.Delete("New Counter Category");
        }
        // Bind the counters to a PerformanceCounterCategory.
        PerformanceCounterCategory myCategory = 
            PerformanceCounterCategory.Create("New Counter Category", 
            "Category Help", myCol);

        Console.WriteLine("Counter Information:");
        Console.WriteLine("Category Name: " + myCategory.get_CategoryName());
        for (int i = 0; i < myCol.get_Count();
 i++) {
            // Display the properties of the CounterCreationData objects.
            Console.WriteLine("CounterName : " 
                + myCol.get_Item(i).get_CounterName());
            Console.WriteLine("CounterHelp : " 
                + myCol.get_Item(i).get_CounterHelp());
            Console.WriteLine("CounterType : " 
                + myCol.get_Item(i).get_CounterType());
        }
    } //main
} //MyCounterCreationData
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
CounterCreationData クラス
CounterCreationData メンバ
System.Diagnostics 名前空間
CounterType
CounterName
CounterHelp



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

辞書ショートカット

すべての辞書の索引

「CounterCreationData コンストラクタ」の関連用語

CounterCreationData コンストラクタのお隣キーワード
検索ランキング

   

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



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

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

©2024 GRAS Group, Inc.RSS