Asha
Asha

Reputation: 4311

Simple ,fast script support for a c# application

I have developed an application which can create Xml files from Xml schema with some user defined rules for generating value for each node.

I want to give my user the ability to write scripts for generating value for each node and in this scripts user should be able to refer to generated value of other nodes . a simple script will be something like :

returtn (@node1.value + 10) ;

I don't know what will be the value of @node1.value because the file generation process hasn't started yet.

so what is the solution do I have to replace it every time with the generated value and then run the script or is there a better way to do something like this ?

may be I have to run this script thousand of times to generate value for created instances so which scripting language is the fastest one for me to use ?

thanks

Upvotes: 2

Views: 460

Answers (4)

Alex
Alex

Reputation: 13229

PowerShell embeds well into a C# application, here's how from the PowerShell Team Blog

Upvotes: 0

Richard
Richard

Reputation: 22016

Have you looked at using C# as your scripting language?

http://www.csscript.net/

Upvotes: 3

avpaderno
avpaderno

Reputation: 29669

You can look at IronPython.
If you are looking for a script language with a sysntax similar to C#, then you can look at CS-Script.

Upvotes: 3

Ilya Khaprov
Ilya Khaprov

Reputation: 2524

Use locks :-). If someone invokes get_method of the property that isn't set just lock the caller until value is set.

Upvotes: 0

Related Questions