Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
C# version of VFP PEMSTATUS()
Message
From
19/01/2010 17:16:23
 
 
To
19/01/2010 15:54:07
John Baird
Coatesville, Pennsylvania, United States
General information
Forum:
ASP.NET
Category:
Other
Environment versions
Environment:
C# 2.0
Miscellaneous
Thread ID:
01444636
Message ID:
01444840
Views:
46
>>>>Look at Bonnie's article in April 2007 of Universal Thread Magazine:
>>>>
>>>>http://www.levelextreme.com/ViewPageArticle.aspx?Session=352B65654B536B4830706B3D204F455A6670646F5559727967654E5A6F6B55635076513D3D
>>>
>>>Looks like Bonnie omitted a parameter:
if (PemStatus(oObject, "SetFocusAtAdd") && _
:-{

>>
>>Oops, yep, looks like it. My bad.
>>
>>The underscore in that line, which is a continuation character in VB but not valid in C#, was added to what I originally submitted (this was C# code) ... the magazine editor must have done that.
>>
>>~~Bonnie
>
>
>You can also use linQ to see if the property exists and to return the properties value.
>
>if( MyClass.GetType().GetProperty (propName) != null)
>{
>     object propValue = MyClass.GetType().GetProperty(propName).GetValue(MyClass, new object[]{});
>}
>
Where does Linq come into that?
Oh - and before Gregory beats me to it - assigning a value to GetProperty() in the if clause would avoid having to re-evaluate if it's not null.....
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform