Question : vb.net, reflection, copying some similar fields from one object to another

I am having trouble using reflection to write a generic field by field copier.  I would like a function that will copy some fields from one class object to another. I want it to only copy the fields where the name and type of the fields are the same. Then I would like the remaining fields to be stored in a collection for me enumerate for special functions.

Thanks in advance!!
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
Dim t as transactions
Dim tran(10) as myTransactions

Dim fromFields As FieldInfo() = t.GetType.GetFields(BindingFlags.NonPublic Or BindingFlags.Instance Or BindingFlags.Public)
Dim toFields As FieldInfo() = tran(i).GetType.GetFields(BindingFlags.NonPublic Or BindingFlags.Instance Or BindingFlags.Public)

Dim myMember As MemberInfo
Dim myField As MemberInfo
Dim myAttribs() As Attribute

Dim myField As FieldInfo
Dim myToField As FieldInfo

' I can enumerate the field list
' now sure how to proceed
For Each myField In toFields

  'myToField = Array.Find(fromFields, AddressOf MatchField)

  ' help

Next

Answer : vb.net, reflection, copying some similar fields from one object to another

you can set visibility through style

document.getElementById('idofelement').style.display("none"); //hide element
document.getElementById('idofelement').style.display(""); //display element

css display will make the element invisible and also hide it from the page so elements will shift as if the element you hid was gone from the page

document.getElementById('idofelement').style.visibility("hidden"); //hide element
document.getElementById('idofelement').style.visibility("visible"); //display element

css visibility will make the item invisible, but it will still hold it's place on the page

for example if you had 3 images, and you used css display property to hide the middle image, the third image would move to be next to the first image, as if there was no 2nd image there. If you used visibility to hide the middle image, then the middle image would disappear and it would look like there was an empty space the size of the middle picture between pictures 1 and 3
Random Solutions  
 
programming4us programming4us