Code Snippet
- Private Sub SetPrivateProperty(Of t)(
- ByVal targertObject As t,
- ByVal targetPropertyName As String,
- ByVal targetPropertyValue As Object
- )
- Dim type As Type = targertObject.GetType
- type.InvokeMember(targetPropertyName,
- BindingFlags.NonPublic Or
- BindingFlags.SetProperty Or
- BindingFlags.Instance, Nothing,
- targertObject, New Object() {targetPropertyValue})
- End Sub
Copy As HTML extension:
'via Blog this'
No comments:
Post a Comment