.NET Base Validator and reflection -
I'm creating dynamic authenticators and a method that invests the property and the supply to the property I am implementing and Value passing value.
This is working for most properties but when I try to open the type method of comparing the operator method or the valuer, I get an error saying that the property can not be found. The code I am using is below, I know that it needs to deal with the error, but I am still in the initial development and want to see where it flies from through the debugger, I can see That supplied as Parmatus Obj is actually a CompareValidator and the properties can not be found. I thought it could only be looking for a base property, (I grieve the base verifier in the caller), but it works on ControlToCompare which is not a member of the BaseValidator. Any help would be appreciated.
'' '& lt; Summary & gt; '' 'Invites a property on the item of supply' '' & lt; / Summary & gt; & Lt; / Param & gt; Object to call on property; & Lt; Param name = "obj" & gt; '' '& Lt; Ultimate name = "Property name" & gt; Property Name & amp; Lt; / Param & gt; '' '& Lt; Param name = "propertyValue" & gt; Property Value & lt; / Param & gt; '' '& Lt; Returns & gt; & Lt; / Returns & gt; '' '& Lt; Comment & gt; Reflection used for calling property & lt; / Remark & gt; Personal function InvokeProperty (ByVal Obj as object, byVal PropertyName as string, byVal PropertyValue as String) String Parameter (0) = PropertyValue return Obj.GetType () as object dim parameter (0) . InvokeMember (PropertyName, Reflection.BindingFlags.SetProperty, Nothing, Obj, Parameter) End Function
I think that you are doing the correcting path with Obje.GetType () what is the downconverting path? The debugger will show that the parameter is CompareValidator, as it is, but this information is available for the method if you can not have it in it before it is gloomy.
Comments
Post a Comment