Link to home
Start Free TrialLog in
Avatar of ljbenson
ljbenson

asked on

Embedded scripting language for C#?

I'm designing a business application in C#  that will allow the end-user to extend and automate some of the processes (like sending emails and checking stock levels), and I want to offer a scripting language interface for doing that as well as a wizard-type interface with drop down boxes, etc.

What I'm wondering is, whether I'd need to design a scripting language myself from scratch, and map some of the scripting functions to internal C# classes, etc, or whether there's something I can plug in and just update some kinda configuration file to define custom functions?

I want to make it really simple for the end user, to do things like...

If (Customer.HasPurchased(ProductA))
Customer.SendEmail(ThankYou)
End If

Any suggestions?
Avatar of Mike Tomlinson
Mike Tomlinson
Flag of United States of America image

"or whether there's something I can plug in and just update some kinda configuration file to define custom functions?"

I think that's just wishful thinking...

You can use native C# by utilizing the Reflection.Emit namespace.
http://msdn2.microsoft.com/en-us/library/system.reflection.emit(vs.71).aspx

Or you could allow the use of VBScript via the Microsoft Script Control.
http://www.microsoft.com/mind/0799/script/script.asp
ASKER CERTIFIED SOLUTION
Avatar of gregoryyoung
gregoryyoung
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of ljbenson
ljbenson

ASKER

Greg, I'll take a look at WF, thanks.

I haven't used it yet, so I'm not sure how close that comes to what I'm trying to do. Essentially, my software will be part desktop, part server-side.

I'd like for my users to create a "flow chart", of sorts, that defines processes within the software. Since it's an e-commerce/business automation tool, that will be things like "If customer is from X, then do X, else do X" type thing.

I'd also like to use some embedded personalization variables in stuff like e-mails...  so they can write "Hi %Customer.Name%", etc.

Thanks.
That is exactly what workflow does :)