Click here to Skip to main content
15,900,258 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: Convert VB to C# Pin
Pavlex47-Dec-16 21:31
Pavlex47-Dec-16 21:31 
GeneralRe: Convert VB to C# Pin
Eddy Vluggen8-Dec-16 3:02
professionalEddy Vluggen8-Dec-16 3:02 
GeneralRe: Convert VB to C# Pin
Pavlex48-Dec-16 7:55
Pavlex48-Dec-16 7:55 
GeneralRe: Convert VB to C# Pin
Pavlex48-Dec-16 12:27
Pavlex48-Dec-16 12:27 
GeneralRe: Convert VB to C# Pin
Eddy Vluggen9-Dec-16 2:59
professionalEddy Vluggen9-Dec-16 2:59 
GeneralRe: Convert VB to C# Pin
Pavlex49-Dec-16 7:28
Pavlex49-Dec-16 7:28 
GeneralRe: Convert VB to C# Pin
Eddy Vluggen9-Dec-16 7:58
professionalEddy Vluggen9-Dec-16 7:58 
QuestionEquals/Comparison of the two objects in which the property of the list(as object) Pin
Cvele12329-Nov-16 4:29
Cvele12329-Nov-16 4:29 
example:

Public Class Clubcard
Implements IComparable

'''
''' Šifra
'''

Public Property Key As String

'''
''' Ime
'''

Public Property FirstName As String

'''
''' Priimek
'''

Public Property LastName As String

'''
''' Ulica
'''

Public Property Street As String

'''
''' Rojstnodnevni datum
'''

Public Property BirthDate As Date

'''
''' Poštna številka
'''

Public Property PostCode As String

'''
''' Kraj / pošta
'''

Public Property City As String

'''
''' Bonitete
'''

Public Property Bonuses As List(Of Bonus)
End Class


Private Shared Function Compare(Of T)(Object1 As T, object2 As T) As Boolean
'Get the type of the object
Dim type As Type = GetType(T)

'return false if any of the object is false
If Object.Equals(Object1, Nothing) OrElse Object.Equals(object2, Nothing) Then
Return False
End If

'Loop through each properties inside class and get values for the property from both the objects and compare
For Each [property] As System.Reflection.PropertyInfo In type.GetProperties()
If [property].Name <> "ExtensionData" Then

If [property].PropertyType.Name = GetType(List(Of )).Name Then
'I do not know what to do!!!!!!!!!!!!!!!!!?????????????

Else
Dim Object1Value As String = String.Empty
Dim Object2Value As String = String.Empty
If type.GetProperty([property].Name).GetValue(Object1, Nothing) IsNot Nothing Then
Object1Value = type.GetProperty([property].Name).GetValue(Object1, Nothing).ToString()
End If
If type.GetProperty([property].Name).GetValue(object2, Nothing) IsNot Nothing Then
Object2Value = type.GetProperty([property].Name).GetValue(object2, Nothing).ToString()
End If
If Object1Value.Trim() <> Object2Value.Trim() Then
Return False
End If

End If
End If
Next
Return True
End Function
QuestionRe: Equals/Comparison of the two objects in which the property of the list(as object) Pin
ZurdoDev29-Nov-16 6:20
professionalZurdoDev29-Nov-16 6:20 
AnswerRe: Equals/Comparison of the two objects in which the property of the list(as object) Pin
Cvele12329-Nov-16 6:28
Cvele12329-Nov-16 6:28 
AnswerRe: Equals/Comparison of the two objects in which the property of the list(as object) Pin
Cvele1239-Dec-16 2:05
Cvele1239-Dec-16 2:05 
QuestionWhy the picture not save correctly if I change from button click to form load Pin
Munirah Malik28-Nov-16 15:46
Munirah Malik28-Nov-16 15:46 
AnswerRe: Why the picture not save correctly if I change from button click to form load Pin
Peter Leow28-Nov-16 17:57
professionalPeter Leow28-Nov-16 17:57 
QuestionFolder traverse in vbscript Pin
Member 126754628-Nov-16 0:17
Member 126754628-Nov-16 0:17 
AnswerRe: Folder traverse in vbscript Pin
Richard MacCutchan28-Nov-16 0:39
mveRichard MacCutchan28-Nov-16 0:39 
GeneralRe: Folder traverse in vbscript Pin
Member 126754628-Nov-16 1:02
Member 126754628-Nov-16 1:02 
GeneralRe: Folder traverse in vbscript Pin
Richard MacCutchan28-Nov-16 1:19
mveRichard MacCutchan28-Nov-16 1:19 
GeneralRe: Folder traverse in vbscript Pin
Member 126754628-Nov-16 1:28
Member 126754628-Nov-16 1:28 
GeneralRe: Folder traverse in vbscript Pin
Tim Carmichael28-Nov-16 5:01
Tim Carmichael28-Nov-16 5:01 
GeneralRe: Folder traverse in vbscript Pin
Member 126754630-Nov-16 22:05
Member 126754630-Nov-16 22:05 
GeneralRe: Folder traverse in vbscript Pin
Richard MacCutchan28-Nov-16 6:34
mveRichard MacCutchan28-Nov-16 6:34 
GeneralRe: Folder traverse in vbscript Pin
Dave Kreskowiak28-Nov-16 8:56
mveDave Kreskowiak28-Nov-16 8:56 
GeneralRe: Folder traverse in vbscript Pin
Member 126754629-Nov-16 22:55
Member 126754629-Nov-16 22:55 
GeneralRe: Folder traverse in vbscript Pin
Dave Kreskowiak30-Nov-16 5:36
mveDave Kreskowiak30-Nov-16 5:36 
QuestionHelp Needed Again: Funny Effects about My.Settings Pin
Sonhospa26-Nov-16 2:49
Sonhospa26-Nov-16 2:49 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.