<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
<title>IronRuby tutorial</title>
<style type="text/css">
html, body {
height: 99%;
overflow: auto;
}
body {
padding: 0;
margin: 0;
}
#silverlightControlHost {
height: 100%;
}
#errorLocation {
font-size: small;
color: Gray;
}
</style>
<script type="text/javascript">
window.DLR = {}
DLR.settings = {width: "100%", height: "100%", source: 'app.xap', background: 'white', windowless: 'true'}
</script>
<script type="text/javascript" src="js/dlr.js"></script>
<!-- Force Python to be registered so it can be used in the tutorial -->
<script type="text/python"></script>
</head>
<body>
<!-- needed for testing -->
<script type='text/ruby' src='test/silverlight.rb'></script>
<script type='text/ruby' src='test/test_console.rb'></script>
<script type='text/ruby' src='console_tutorial.rb'></script>
<script type="text/ruby">
include Microsoft::Scripting::Silverlight
def load_assembly_from_path(path)
DynamicApplication.current.runtime.host.platform_adaptation_layer.
load_assembly_from_path(path)
end
# From Silverlight 3 SDK
load_assembly_from_path "System.Windows.Controls.dll"
require 'System.Windows.Controls'
# From Silverlight 3 Toolkit
load_assembly_from_path "System.Windows.Controls.Toolkit.dll"
require 'System.Windows.Controls.Toolkit'
require 'gui_tutorial'
Application.Current.RootVisual = GuiTutorial::Window.current
if document.query_string.keys.include?('test')
$repl = Repl.show('ruby')
$stdout = $repl.output_buffer
$stderr = $repl.output_buffer
require "test/silverlight"
end
</script>
</body>
</html>