Re: DLR Winforms/Console?
what is the full form of DLR ?
Re: DLR Winforms/Console?
Im sorry i dont have a clue what you are on about... on the plus side ive managed to scrounge together some info to get me started...
If anyone else like me is a bit baffled as to how to start... go to codeplex and download ironpython/ruby (NOT THE SILVERLIGHT ONLY VERSIONS :( ). Then make a console app and add the following:
Code:
using System;
using IronPython.Hosting;
using Microsoft.Scripting;
using Microsoft.Scripting.Hosting;
namespace DLRTest
{
class Program
{
private static ScriptEngine m_ScriptEngine;
private static ScriptRuntime m_ScriptRuntime;
private static ScriptScope m_ScriptScope;
static void Main(string[] args)
{
m_ScriptEngine = Python.CreateEngine();
m_ScriptRuntime = m_ScriptEngine.Runtime;
m_ScriptScope = m_ScriptRuntime.CreateScope();
StartApp();
Console.WriteLine("Press Enter To Exit");
Console.ReadKey();
}
static void StartApp()
{
int var = 5;
string Code = "var + 10";
m_ScriptScope.SetVariable("var", var);
ScriptSource CodeSource = m_ScriptEngine.CreateScriptSourceFromString(Code, SourceCodeKind.Expression);
var = (int)CodeSource.Execute(m_ScriptScope);
Console.WriteLine(var);
}
}
}
Now i want to be able to bind to objects, so lets say i have an object like below:
Code:
public class User
{
public int ID;
public string Name;
public byte Status;
}
i would want to be able to change the values of this object in the DLR and attach to events in the DLR... im sure ive seen various blurbs about people binding events from objects created in c# to objects in the DLR so they will react to mouseover events etc... anyone who can share this knowledge would be a hero in my book!