PropertyCollection クラス
定義
重要
一部の情報は、リリース前に大きく変更される可能性があるプレリリースされた製品に関するものです。 Microsoft は、ここに記載されている情報について、明示または黙示を問わず、一切保証しません。
DataColumn、DataSet、またはDataTableに追加できるプロパティのコレクションを表します。
public ref class PropertyCollection : System::Collections::Hashtable
public ref class PropertyCollection : System::Collections::Hashtable, ICloneable
public class PropertyCollection : System.Collections.Hashtable
public class PropertyCollection : System.Collections.Hashtable, ICloneable
[System.Serializable]
public class PropertyCollection : System.Collections.Hashtable
type PropertyCollection = class
inherit Hashtable
interface ICloneable
type PropertyCollection = class
inherit Hashtable
[<System.Serializable>]
type PropertyCollection = class
inherit Hashtable
Public Class PropertyCollection
Inherits Hashtable
Public Class PropertyCollection
Inherits Hashtable
Implements ICloneable
- 継承
- 属性
- 実装
例
次の例では、 DataTable のタイムスタンプ値を作成し、 PropertyCollectionに追加します。
private void AddTimeStamp()
{
//Create a new DataTable.
DataTable table = new DataTable("NewTable");
//Get its PropertyCollection.
PropertyCollection properties = table.ExtendedProperties;
//Add a timestamp value to the PropertyCollection.
properties.Add("TimeStamp", DateTime.Now);
// Print the timestamp.
Console.WriteLine(properties["TimeStamp"]);
}
Private Sub AddTimeStamp()
'Create a new DataTable.
Dim table As New DataTable("NewTable")
'Get its PropertyCollection.
Dim properties As PropertyCollection = table.ExtendedProperties
'Add a timestamp value to the PropertyCollection.
properties.Add("TimeStamp", DateTime.Now)
'Print the timestamp.
Console.WriteLine(properties("TimeStamp"))
End Sub
注釈
PropertyCollectionには、ExtendedProperties、DataColumn、またはDataSet クラスのDataTable プロパティを使用してアクセスできます。
DataColumnを使用して、DataSet、DataTable、またはPropertyCollectionオブジェクトにカスタム プロパティを追加します。 たとえば、後で別のオブジェクトと比較するために、オブジェクトの作成時刻を格納することができます。
コンストラクター
| 名前 | 説明 |
|---|---|
| PropertyCollection() |
PropertyCollection クラスの新しいインスタンスを初期化します。 |
| PropertyCollection(SerializationInfo, StreamingContext) |
古い.
PropertyCollection クラスの新しいインスタンスを初期化します。 |
プロパティ
| 名前 | 説明 |
|---|---|
| comparer |
古い.
古い.
IComparerに使用するHashtableを取得または設定します。 (継承元 Hashtable) |
| Count |
Hashtableに含まれるキーと値のペアの数を取得します。 (継承元 Hashtable) |
| EqualityComparer |
IEqualityComparerに使用するHashtableを取得します。 (継承元 Hashtable) |
| hcp |
古い.
古い.
ハッシュ コードを分配できるオブジェクトを取得または設定します。 (継承元 Hashtable) |
| IsFixedSize |
Hashtableに固定サイズがあるかどうかを示す値を取得します。 (継承元 Hashtable) |
| IsReadOnly |
Hashtableが読み取り専用かどうかを示す値を取得します。 (継承元 Hashtable) |
| IsSynchronized |
Hashtableへのアクセスが同期されているかどうかを示す値を取得します (スレッド セーフ)。 (継承元 Hashtable) |
| Item[Object] |
指定したキーに関連付けられている値を取得または設定します。 (継承元 Hashtable) |
| Keys |
ICollection内のキーを含むHashtableを取得します。 (継承元 Hashtable) |
| SyncRoot |
Hashtableへのアクセスを同期するために使用できるオブジェクトを取得します。 (継承元 Hashtable) |
| Values |
ICollection内の値を含むHashtableを取得します。 (継承元 Hashtable) |
メソッド
明示的なインターフェイスの実装
| 名前 | 説明 |
|---|---|
| IEnumerable.GetEnumerator() |
コレクションを反復処理する列挙子を返します。 (継承元 Hashtable) |
拡張メソッド
| 名前 | 説明 |
|---|---|
| AsParallel(IEnumerable) |
クエリの並列化を有効にします。 |
| AsQueryable(IEnumerable) |
IEnumerable を IQueryableに変換します。 |
| Cast<TResult>(IEnumerable) |
IEnumerable の要素を指定した型にキャストします。 |
| OfType<TResult>(IEnumerable) |
指定した型に基づいて、IEnumerable の要素をフィルター処理します。 |