Link to home
Start Free TrialLog in
Avatar of mdbarker813
mdbarker813Flag for United States of America

asked on

Execute C# code at Runtime

I have a need in a drag and drop application to allow users to write "C# code snippets" to that can be exercised on other objects on the application that may have been dropped on at runtime. Everything that I have found basically is requires a static form or doesn't interact with controls on the form. Any ideas?

e.g.
Button1 and Button2 are dropped onto the form at runtime. I need a way to set Button2's text = "Something" by running dynamic C# Code when Button1's ClickEvent is fired...
Avatar of Jarrod
Jarrod
Flag of South Africa image


This is a out the box feature in VS2010
Avatar of mdbarker813

ASKER

I need a way to run the code while the app is running. I need more then just a runtime code generation app.
does the code have to be in c# ? how is the code presented to you ?

Do you let users type it in or to you calculate it at runtime ?
The user Writes C# or VB Syntax in a Actipro SyntaxEditor.  Once the code has been written for the method it should run when the use executes the method the code is to run in.
ASKER CERTIFIED SOLUTION
Avatar of Pryrates
Pryrates
Flag of Germany 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
forgot to post content of textbox1 to work with posted snippet.
namespace myspace
{
    class myclass
    {
	public string runme(string parameter)
	{
		return parameter + " world";
	}
    }
}

Open in new window