Ver Mensaje Individual
  #2 (permalink)  
Antiguo 03/04/2005, 17:24
chcma
 
Fecha de Ingreso: junio-2003
Ubicación: Asturias
Mensajes: 2.429
Antigüedad: 21 años, 8 meses
Puntos: 7
Bueno, bueno, bueno, últimamente está un poco paradete el foro, eh !!!, o es que tienen miedo a mis posts de programadores avanzados, jejejeje (Es broma, ¿Eh?, no se lo tomen a mal).

Bueno, al final solucione el tema creando una clase heredara de CollectionBase. Voy a dejar aqui el código, por si le interesa a alguien.

El funcionamiento es muy simple, yo creo una clase del tipo xmlColeccion y despues voy agregando los atributos a usar:
Dim ColecionXML as xmlColeccion = nwe xmlColeccion
ColeccionXML.Insertar(New xmlAtributo("Nombre", "Valor"))
ColeccionXML.Insertar(New xmlAtributo("OtroNombre", "OtroValor"))

Bueno, el código es el siguiente (Son dos clases, naturalmente, xmlColeccion y xmlAtributo)



************************************
************************************

Public Class xmlColeccion
Inherits System.Collections.CollectionBase

Default Property item(ByVal indice As Integer) As xmlAtributo
Get
Return CType(innerlist.Item(indice), xmlAtributo)
End Get
Set(ByVal Value As xmlAtributo)
innerlist.Item(indice) = Value
End Set
End Property

Sub Insertar(ByVal value As xmlAtributo)
innerlist.Add(value)
End Sub
End Class

************************************
************************************


************************************
************************************

Public Class xmlAtributo
Dim NAtributo As String 'Nombre del Atributo
Dim VAtributo As String 'Valor del Atributo

#Region "CONSTRUCTORES"

Private Sub New()
End Sub

Sub New(ByVal atributo As String, ByVal valor As String)
Me.NombreAtributo = atributo
Me.ValorAtributo = valor
End Sub

#End Region

#Region "PROPIEDADES"
Public Property NombreAtributo() As String
Get
Return NAtributo
End Get
Set(ByVal Value As String)
NAtributo = Trim(Value)
End Set
End Property

Public Property ValorAtributo() As String
Get
Return VAtributo
End Get
Set(ByVal Value As String)
VAtributo = Value
End Set
End Property
#End Region
End Class

************************************
************************************


Espero que alguno le valga para algo.

RootK, xKnow y cualquier otro guru, si leen esto . . . . ¡¡ Ya podeis ir dandome sugerencias o cometnarios !!

Bueno, nos vemos, y saludos.
__________________
Charlie.