NEExt
09-02-2009, 06:24 PM
Hopfully this is the right forum for this question, I didn't see a .NET forum for client side development. I'm an intermediately skilled developer and am not sure how to accomplish this.
I'm writing a client side VB.NET app that will perform a series of tasks on a list of clients (a CSV file loaded separately). The goal is to tell the app the research to perform, the conditions to evaluate, and then finally the actions to take if the condition is met with an XML instructional file. In this way, we can modify the app's behavior very easily for different types of runs just by changing the XML.
I'm thinking something like this. The XML parameters that are objects I've put brackets around to help illustrate.
<Instructions>
<Research>
<Action>
<Type>[GetAddress]</Type>
</Action>
<Action>
<Type>[GetName]</Type>
</Action>
</Research>
<Conditions>
<Condition>
<Type>If</Type>
<Source>[Client.Address.State]</Source>
<Compare>EqualTo</Compare>
<Value>CA</Value>
<Actions>
<Action>
<Type>[WriteHistoryToFile]</Type>
</Action>
</Actions>
</Condition>
</Conditions>
</Instructions>
What I want to do is access the objects I need programatically by parsing the XML. Is this possible using System.Reflection? I know I could do it in a select case construct, (and probably will do exactly that with the <Type> of conditions), but the client library is HUGE and writing giant select case statements for every possible property we would need to perform a check against is daunting.
Thanks for any assistance you can provide.
I'm writing a client side VB.NET app that will perform a series of tasks on a list of clients (a CSV file loaded separately). The goal is to tell the app the research to perform, the conditions to evaluate, and then finally the actions to take if the condition is met with an XML instructional file. In this way, we can modify the app's behavior very easily for different types of runs just by changing the XML.
I'm thinking something like this. The XML parameters that are objects I've put brackets around to help illustrate.
<Instructions>
<Research>
<Action>
<Type>[GetAddress]</Type>
</Action>
<Action>
<Type>[GetName]</Type>
</Action>
</Research>
<Conditions>
<Condition>
<Type>If</Type>
<Source>[Client.Address.State]</Source>
<Compare>EqualTo</Compare>
<Value>CA</Value>
<Actions>
<Action>
<Type>[WriteHistoryToFile]</Type>
</Action>
</Actions>
</Condition>
</Conditions>
</Instructions>
What I want to do is access the objects I need programatically by parsing the XML. Is this possible using System.Reflection? I know I could do it in a select case construct, (and probably will do exactly that with the <Type> of conditions), but the client library is HUGE and writing giant select case statements for every possible property we would need to perform a check against is daunting.
Thanks for any assistance you can provide.