Sugerir traducción
 
Otros han sugerido:

progress indicator
No hay más sugerencias.
Evaluar y enviar comentarios
Contraer todo/Expandir todo Contraer todo
Ver contenido:  en paraleloVer contenido: en paralelo
.NET Framework Class Library
PropertyCollection Class

Represents a collection of properties that can be added to DataColumn, DataSet, or DataTable.

System..::.Object
  System.Collections..::.Hashtable
    System.Data..::.PropertyCollection

Namespace:  System.Data
Assembly:  System.Data (in System.Data.dll)
Visual Basic
<SerializableAttribute> _
Public Class PropertyCollection _
    Inherits Hashtable
C#
[SerializableAttribute]
public class PropertyCollection : Hashtable
Visual C++
[SerializableAttribute]
public ref class PropertyCollection : public Hashtable
F#
[<SerializableAttribute>]
type PropertyCollection =  
    class
        inherit Hashtable
    end

The PropertyCollection type exposes the following members.

  NameDescription
Public methodSupported by the XNA FrameworkPropertyCollection()()()Initializes a new instance of the PropertyCollection class.
Protected methodPropertyCollection(SerializationInfo, StreamingContext)Initializes a new instance of the PropertyCollection class.
Top
  NameDescription
Protected propertySupported by the XNA Frameworkcomparer Obsolete. Gets or sets the IComparer to use for the Hashtable. (Inherited from Hashtable.)
Public propertySupported by the XNA FrameworkCountGets the number of key/value pairs contained in the Hashtable. (Inherited from Hashtable.)
Protected propertySupported by the XNA FrameworkEqualityComparerGets the IEqualityComparer to use for the Hashtable. (Inherited from Hashtable.)
Protected propertySupported by the XNA Frameworkhcp Obsolete. Gets or sets the object that can dispense hash codes. (Inherited from Hashtable.)
Public propertySupported by the XNA FrameworkIsFixedSizeGets a value indicating whether the Hashtable has a fixed size. (Inherited from Hashtable.)
Public propertySupported by the XNA FrameworkIsReadOnlyGets a value indicating whether the Hashtable is read-only. (Inherited from Hashtable.)
Public propertySupported by the XNA FrameworkIsSynchronizedGets a value indicating whether access to the Hashtable is synchronized (thread safe). (Inherited from Hashtable.)
Public propertySupported by the XNA FrameworkItemGets or sets the value associated with the specified key. (Inherited from Hashtable.)
Public propertySupported by the XNA FrameworkKeysGets an ICollection containing the keys in the Hashtable. (Inherited from Hashtable.)
Public propertySupported by the XNA FrameworkSyncRootGets an object that can be used to synchronize access to the Hashtable. (Inherited from Hashtable.)
Public propertySupported by the XNA FrameworkValuesGets an ICollection containing the values in the Hashtable. (Inherited from Hashtable.)
Top
  NameDescription
Public methodSupported by the XNA FrameworkAddAdds an element with the specified key and value into the Hashtable. (Inherited from Hashtable.)
Public methodSupported by the XNA FrameworkClearRemoves all elements from the Hashtable. (Inherited from Hashtable.)
Public methodSupported by the XNA FrameworkCloneCreates a shallow copy of the Hashtable. (Inherited from Hashtable.)
Public methodSupported by the XNA FrameworkContainsDetermines whether the Hashtable contains a specific key. (Inherited from Hashtable.)
Public methodSupported by the XNA FrameworkContainsKeyDetermines whether the Hashtable contains a specific key. (Inherited from Hashtable.)
Public methodSupported by the XNA FrameworkContainsValueDetermines whether the Hashtable contains a specific value. (Inherited from Hashtable.)
Public methodSupported by the XNA FrameworkCopyToCopies the Hashtable elements to a one-dimensional Array instance at the specified index. (Inherited from Hashtable.)
Public methodSupported by the XNA FrameworkEquals(Object)Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Protected methodSupported by the XNA FrameworkFinalizeAllows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.)
Public methodSupported by the XNA FrameworkGetEnumeratorReturns an IDictionaryEnumerator that iterates through the Hashtable. (Inherited from Hashtable.)
Protected methodSupported by the XNA FrameworkGetHashReturns the hash code for the specified key. (Inherited from Hashtable.)
Public methodSupported by the XNA FrameworkGetHashCodeServes as a hash function for a particular type. (Inherited from Object.)
Public methodGetObjectDataImplements the ISerializable interface and returns the data needed to serialize the Hashtable. (Inherited from Hashtable.)
Public methodSupported by the XNA FrameworkGetTypeGets the Type of the current instance. (Inherited from Object.)
Protected methodSupported by the XNA FrameworkKeyEqualsCompares a specific Object with a specific key in the Hashtable. (Inherited from Hashtable.)
Protected methodSupported by the XNA FrameworkMemberwiseCloneCreates a shallow copy of the current Object. (Inherited from Object.)
Public methodOnDeserializationImplements the ISerializable interface and raises the deserialization event when the deserialization is complete. (Inherited from Hashtable.)
Public methodSupported by the XNA FrameworkRemoveRemoves the element with the specified key from the Hashtable. (Inherited from Hashtable.)
Public methodSupported by the XNA FrameworkToStringReturns a string that represents the current object. (Inherited from Object.)
Top
  NameDescription
Explicit interface implemetationPrivate methodSupported by the XNA FrameworkIEnumerable..::.GetEnumeratorReturns an enumerator that iterates through a collection. (Inherited from Hashtable.)
Top

The PropertyCollection can be accessed through the ExtendedProperties property of the DataColumn, DataSet, or DataTable class.

Add custom properties to the DataColumn, DataSet, or DataTable objects through the PropertyCollection. For example, you may want to store the time of the object's creation for later comparison to another object.

The following example creates a timestamp value for a DataTable and adds it to the PropertyCollection.

Visual Basic
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 
C#
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"]);
}

.NET Framework

Supported in: 4, 3.5, 3.0, 2.0, 1.1, 1.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows XP SP2 x64 Edition, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role not supported), Windows Server 2003 SP2

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.
Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
Biblioteca de clases de .NET Framework
PropertyCollection (Clase)

Representa una colección de propiedades que se pueden agregar al DataColumn, DataSet o DataTable.

System..::.Object
  System.Collections..::.Hashtable
    System.Data..::.PropertyCollection

Espacio de nombres:  System.Data
Ensamblado:  System.Data (en System.Data.dll)
Visual Basic
<SerializableAttribute> _
Public Class PropertyCollection _
    Inherits Hashtable
C#
[SerializableAttribute]
public class PropertyCollection : Hashtable
Visual C++
[SerializableAttribute]
public ref class PropertyCollection : public Hashtable
F#
[<SerializableAttribute>]
type PropertyCollection =  
    class
        inherit Hashtable
    end

El tipo PropertyCollection expone los siguientes miembros.

  NombreDescripción
Método públicoCompatible con XNA FrameworkPropertyCollection()()()Inicializa una nueva instancia de la clase PropertyCollection.
Método protegidoPropertyCollection(SerializationInfo, StreamingContext)Inicializa una nueva instancia de la clase PropertyCollection.
Arriba
  NombreDescripción
Propiedad protegidaCompatible con XNA Frameworkcomparer Obsoleto. Obtiene o establece el objeto IComparer que se utilizará para Hashtable. (Se hereda de Hashtable).
Propiedad públicaCompatible con XNA FrameworkCountObtiene el número de pares de clave y valor incluidos en Hashtable. (Se hereda de Hashtable).
Propiedad protegidaCompatible con XNA FrameworkEqualityComparerObtiene el IEqualityComparer que se va a utilizar para Hashtable. (Se hereda de Hashtable).
Propiedad protegidaCompatible con XNA Frameworkhcp Obsoleto. Obtiene o establece el objeto que puede dispensar códigos hash. (Se hereda de Hashtable).
Propiedad públicaCompatible con XNA FrameworkIsFixedSizeObtiene un valor que indica si Hashtable tiene un tamaño fijo. (Se hereda de Hashtable).
Propiedad públicaCompatible con XNA FrameworkIsReadOnlyObtiene un valor que indica si Hashtable es de sólo lectura. (Se hereda de Hashtable).
Propiedad públicaCompatible con XNA FrameworkIsSynchronizedObtiene un valor que indica si el acceso a Hashtable está sincronizado (es seguro para la ejecución de subprocesos). (Se hereda de Hashtable).
Propiedad públicaCompatible con XNA FrameworkItemObtiene o establece el valor asociado a la clave especificada. (Se hereda de Hashtable).
Propiedad públicaCompatible con XNA FrameworkKeysObtiene una ICollection que contiene las claves de Hashtable. (Se hereda de Hashtable).
Propiedad públicaCompatible con XNA FrameworkSyncRootObtiene un objeto que se puede utilizar para sincronizar el acceso a Hashtable. (Se hereda de Hashtable).
Propiedad públicaCompatible con XNA FrameworkValuesObtiene un objeto ICollection que contiene los valores de Hashtable. (Se hereda de Hashtable).
Arriba
  NombreDescripción
Método públicoCompatible con XNA FrameworkAddAgrega un elemento con la clave y el valor especificados a Hashtable. (Se hereda de Hashtable).
Método públicoCompatible con XNA FrameworkClearQuita todos los elementos de Hashtable. (Se hereda de Hashtable).
Método públicoCompatible con XNA FrameworkCloneCrea una copia superficial de Hashtable. (Se hereda de Hashtable).
Método públicoCompatible con XNA FrameworkContainsDetermina si Hashtable contiene una clave específica. (Se hereda de Hashtable).
Método públicoCompatible con XNA FrameworkContainsKeyDetermina si Hashtable contiene una clave específica. (Se hereda de Hashtable).
Método públicoCompatible con XNA FrameworkContainsValueDetermina si Hashtable contiene un valor específico. (Se hereda de Hashtable).
Método públicoCompatible con XNA FrameworkCopyToCopia los elementos de Hashtable a una instancia unidimensional de Array en el índice especificado. (Se hereda de Hashtable).
Método públicoCompatible con XNA FrameworkEquals(Object)Determina si el objeto Object especificado es igual al objeto Object actual. (Se hereda de Object).
Método protegidoCompatible con XNA FrameworkFinalizePermite que un objeto intente liberar recursos y realizar otras operaciones de limpieza antes de ser reclamado por la recolección de elementos no utilizados. (Se hereda de Object).
Método públicoCompatible con XNA FrameworkGetEnumeratorDevuelve un IDictionaryEnumerator que recorre en iteración Hashtable. (Se hereda de Hashtable).
Método protegidoCompatible con XNA FrameworkGetHashDevuelve el código hash de la clave especificada. (Se hereda de Hashtable).
Método públicoCompatible con XNA FrameworkGetHashCodeActúa como función hash para un tipo concreto. (Se hereda de Object).
Método públicoGetObjectDataImplementa la interfaz de ISerializable y devuelve los datos necesarios para serializar Hashtable. (Se hereda de Hashtable).
Método públicoCompatible con XNA FrameworkGetTypeObtiene el objeto Type de la instancia actual. (Se hereda de Object).
Método protegidoCompatible con XNA FrameworkKeyEqualsCompara un Object específico con una clave concreta en Hashtable. (Se hereda de Hashtable).
Método protegidoCompatible con XNA FrameworkMemberwiseCloneCrea una copia superficial del objeto Object actual. (Se hereda de Object).
Método públicoOnDeserializationImplementa la interfaz ISerializable y genera el evento de deserialización cuando esta finaliza. (Se hereda de Hashtable).
Método públicoCompatible con XNA FrameworkRemoveQuita el elemento con la clave especificada de Hashtable. (Se hereda de Hashtable).
Método públicoCompatible con XNA FrameworkToStringDevuelve una cadena que representa el objeto actual. (Se hereda de Object).
Arriba
  NombreDescripción
Implementación explícita de interfacesMétodo privadoCompatible con XNA FrameworkIEnumerable..::.GetEnumeratorDevuelve un enumerador que recorre en iteración una colección. (Se hereda de Hashtable).
Arriba

Se puede obtener acceso a PropertyCollection mediante la propiedad ExtendedProperties de la clase DataColumn, DataSet o DataTable.

Agrega propiedades personalizadas a los objetos DataColumn, DataSet o DataTable mediante PropertyCollection. Por ejemplo, es posible que desee almacenar la hora de creación del objeto para su posterior comparación con la de otro objeto.

En el siguiente ejemplo se crea un valor de marca de hora para DataTable y se agrega a PropertyCollection.

Visual Basic
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 
C#
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"]);
}

.NET Framework

Compatible con: 4, 3.5, 3.0, 2.0, 1.1, 1.0

.NET Framework Client Profile

Compatible con: 4, 3.5 SP1

Windows 7, Windows Vista SP1 o posterior, Windows XP SP3, Windows XP SP2 x64 Edition, Windows Server 2008 (no se admite Server Core), Windows Server 2008 R2 (se admite Server Core con SP1 o posterior), Windows Server 2003 SP2

.NET Framework no admite todas las versiones de todas las plataformas. Para obtener una lista de las versiones compatibles, vea Requisitos de sistema de .NET Framework.
Todos los miembros static (Shared en Visual Basic) públicos de este tipo son seguros para la ejecución de subprocesos. No se garantiza que los miembros de instancias sean seguros para la ejecución de subprocesos.
Contenido de la comunidad   ¿Qué es Community Content?
Agregar contenido nuevo RSS  Anotaciones
Processing
© 2012 Microsoft. Reservados todos los derechos. Términos de uso | Marcas Registradas | Privacidad
Page view tracker