I created an Custom Munger with type detection for my ObjectListview.
It's very basic, and I think you could do much better and integrate it.
Here it is :
Private Function TypedValue(ByVal InType As System.Type, ByVal Value As Object) As Object
Select Case InType
Case GetType(String)
Return Value.ToString
Case GetType(Single)
Return Convert_To_Sng(Value)
Case GetType(Double)
Return Convert_To_Dbl(Value)
Case Else
Return Value
End Select
End Function
and in the PutValue method
If (Me.resolvedPropertyInfo IsNot Nothing) Then >me.resolvedPropertyInfo.SetValue(target,
TypedValue(resolvedPropertyInfo.PropertyType, value),
Nothing)
Return True
End If
I added this because I wanted a default aspect putter, and using the SimpleMunger, I had errors with PutAspectByName method when I had single/double fields.
I Thought it could be useful !
The Munger can put any value that is implicitly convertable to the target type. For this to work, the value retrieved by the Munger must be convertable to the put target type.
If you want more specific conversions, you can always install an aspect getter/putter.