Visual Basic (Declaration) | |
---|---|
Public Function New( _ ByVal instance As Object, _ ByVal name As String _ ) |
Parameters
- instance
- An instance of an object to retrieve the property/field from
- name
- The name of the property or field
Library/Library.Test/TestPropertyValue.cs
C# | Copy Code |
---|---|
a obj = new a(); obj.PropertyA = "a"; PropertyValue<string> pt = new PropertyValue<string>(obj, "privateField"); Assert.AreEqual("a", pt.Value); pt.Value = "b"; Assert.AreEqual("b", pt.Value); |
VB.NET | Copy Code |
---|---|
Dim obj As New a() obj.PropertyA = "a" Dim pt As New PropertyValue(Of String)(obj, "privateField") Assert.AreEqual("a", pt.Value) pt.Value = "b" Assert.AreEqual("b", pt.Value) |
Target Platforms: Windows XP, Windows Server 2003, Windows Vista, Windows Server 2008, Windows 7
Reference
PropertyValue<T> ClassPropertyValue<T> Members