jschementi / mix09
- Source
- Commits
- Network (0)
- Issues (0)
- Downloads (0)
- Wiki (1)
- Graphs
-
Branch:
master
| name | age | message | |
|---|---|---|---|
| |
.gitignore | Thu Mar 12 19:06:46 -0700 2009 | |
| |
.gitmodules | Wed Mar 18 23:05:15 -0700 2009 | |
| |
AgDLR/ | Sat Mar 28 21:48:01 -0700 2009 | |
| |
Calculator/ | Thu Apr 02 02:52:23 -0700 2009 | |
| |
Eggs/ | Sat Mar 28 21:48:01 -0700 2009 | |
| |
IronMVC/ | Thu Mar 19 17:24:23 -0700 2009 | |
| |
README.markdown | Wed Mar 18 14:23:18 -0700 2009 | |
| |
Sample.Tests/ | Sat Mar 28 22:50:27 -0700 2009 | |
| |
TicTacToe/ | Sat Mar 28 22:04:31 -0700 2009 | |
| |
env.bat | Thu Mar 12 01:04:25 -0700 2009 | |
| |
extension-example/ | Tue Mar 17 08:08:36 -0700 2009 | |
| |
spreadsheet - 645fce8 | Sun Mar 29 15:01:29 -0700 2009 |
Silverlight Dynamic Lanugage Demos for MIX 09
TicTacToe
Testing C# Silverlight application with IronRuby
To run, open TicTacToe\TicTacToe.sln in Visual Studio. TicTacToe.Web is a ASP.NET MVC project, so install ASP.NET MVC here: http://aspnet.codeplex.com/Wiki/View.aspx?title=MVC&referringTitle=Home
Make sure TicTacToe.Web is the start project, and TicTacToeTestPage.aspx is the start page.
To run tests, add "?test" to the end of the URL.
Calculator
A calculator with IronPython functions
To run, open Calculator\Calculator.sln in Visual Studio. TicTacToe.Web is a ASP.NET MVC project, so install ASP.NET MVC here: http://aspnet.codeplex.com/Wiki/View.aspx?title=MVC&referringTitle=Home
Make sure Calculator.Web is the start project, and CalculatorTestAppTestPage.aspx is the start page.
When you add a valid python function in the right textbox, buttons will be created above to run the functions, with the first argument being the current calculator value.
To run tests, add "?test" to the end of the URL.
AgDLR
Making Silverlight applications in DLR languages
See http://github.com/jschementi/agdlr for more information
Eggs
Testing Silverlight applications with IronRuby
TicTacToe and Calculator use Eggs to run tests. See http://github.com/jschementi/eggs for more information.
Silverlight Extensions
Silverlight 3 supports extension for platform components, such as controls the DLR, etc. Run extension-example\server.bat to see how extensions work.
To use the DLR extensions in your application, add a Deployment.ExternalParts section to your AppManifest.xaml file (or Properties\AppManifest.xml) if it's a C#/VB Silverlight project).
<Deployment.ExternalParts>
<!-- Required: Microsoft.Scripting(Core, Silverlight, ExtensionAttribute) -->
<ExtensionPart Source="http://go.microsoft.com/fwlink/?LinkID=146361" />
<!-- IronRuby and IronRuby.Libraries -->
<ExtensionPart Source="http://go.microsoft.com/fwlink/?LinkID=146359" />
<!-- IronPython and IronPython.Modules -->
<ExtensionPart Source="http://go.microsoft.com/fwlink/?LinkID=146360" />
</Deployment.ExternalParts>
If you are not using IronRuby in your application, you can remove its ExtensionPart entry, and the same for IronPython. However, the first one is required, as it points to Microsot.Scripting.* DLLs.
Also, if you are using these in a C#/VB Silverlight application, you need to keep the local references to Microsoft.Scripting.dll and Iron.dll so it builds, but you don't want them packaged inside the XAP. To accomplish this, select all those DLLs, right-click and select "Properties", and set "Copy Local" to "False".
Lastly, in a C#/VB application you must tell the DLR to load and register any extension assemblies before using any DLR features. This can simply be accomplished by wrapping the setting of RootVisual with a call to DynamicApplication.LoadAssemblies:
DynamicApplication.LoadAssemblies(delegate() {
this.RootVisual = new Page();
});
