jschementi / mix09

Demos for Mix 09

This URL has Read+Write access

mix09 /
name age message
file .gitignore Thu Mar 12 19:06:46 -0700 2009 unignore the clientbin directories (where TicTa... [Jimmy Schementi]
file .gitmodules Wed Mar 18 23:05:15 -0700 2009 Fix tests, add offline support (only without ex... [Jimmy Schementi]
directory AgDLR/ Sat Mar 28 21:48:01 -0700 2009 More complete calculator tests, make calculator... [Jimmy Schementi]
directory Calculator/ Thu Apr 02 02:52:23 -0700 2009 Clean up *_test.rb files by moving things to he... [Jimmy Schementi]
directory Eggs/ Sat Mar 28 21:48:01 -0700 2009 More complete calculator tests, make calculator... [Jimmy Schementi]
directory IronMVC/ Thu Mar 19 17:24:23 -0700 2009 use a private extension path [Jimmy Schementi]
file README.markdown Wed Mar 18 14:23:18 -0700 2009 Additional extension instructions [jschementi]
directory Sample.Tests/ Sat Mar 28 22:50:27 -0700 2009 Add Sample.Tests, a starter project for testing... [Jimmy Schementi]
directory TicTacToe/ Sat Mar 28 22:04:31 -0700 2009 TicTacToe didn't know where Chiron was [Jimmy Schementi]
file env.bat Thu Mar 12 01:04:25 -0700 2009 Adds AgDLR binary build, Eggs.xap, gitignore, a... [unknown]
directory extension-example/ Tue Mar 17 08:08:36 -0700 2009 Add extension references [Jimmy Schementi]
submodule spreadsheet - 645fce8 Sun Mar 29 15:01:29 -0700 2009 Update to latest spreadsheet [Jimmy Schementi]
README.markdown

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();
});