Buenas tardes,
gracias por el consejo Malenko.
He comenzado a hacerlo y no sé si me estoy liando o voy en el camino correcto. A ver si me podéis echar una mano.
He creado la clase Device tal que:
Código vb:
Ver originalPublic Class Device
Implements IComparable
Private _ip As String
Private _maquina As String
Private _producto As String
Private _orden As String
Private _lote As String
Private _config As DeviceConfig
Public Overloads Function CompareTo(ByVal obj As Object) As Integer Implements IComparable.CompareTo
If TypeOf obj Is Device Then
Dim temp As Device = CType(obj, Device)
Return Me.config.CompareTo(temp.config)
End If
Throw New ArgumentException("object is not a Device")
End Function
'GETTERS Y SETTERS No los pongo por ahorrar espacio
End Class
La DeviceConfig tal que:
Código vb:
Ver originalPublic Class DeviceConfig
Implements IComparable
Private _maxNumCodesGlobal As Integer
Private _maxNumCodesDataMatrix As Integer
Private _maxNumCodesQR As Integer
Private _maxNumCodesBarcode As Integer
Private _partialResults As String
Private _allowIdenticalSymbols As String
Private _datamatrixValidation As Integer
Private _datamatrixValidationType
Public Overloads Function CompareTo(ByVal obj As Object) As Integer Implements IComparable.CompareTo
If TypeOf obj Is DeviceConfig Then
Dim temp As DeviceConfig = CType(obj, DeviceConfig)
Return Me.CompareTo(temp)
End If
Throw New ArgumentException("object is not a DeviceConfig")
End Function
'GETTERS Y SETTERS No los pongo por ahorrar espacio
End Class
Entonces mi intención en el programa es hacer un:
Código vb:
Ver originalDim a as new Device
'Modificar alguno de los valores de las propiedades de a.config
Dim b as new DeviceConfig
'Modificar alguno de los valores de las propiedades de b
if (a.config.compareTo(b)=0 then
'SON IGUALES
end if
Esto funcionaría si los valores de las propiedades de las dos clases del tipo DeviceConfig son iguales?
Muchas gracias.