# \[Code Review\] Silverlight fixes

**URL:** <https://www.ruby-forum.com/t/code-review-silverlight-fixes/177805>\
**Category:** IronRuby\
**Created:** [October 24, 2009, 1:13am UTC](https://www.ruby-forum.com/t/code-review-silverlight-fixes/177805 "2009-10-24T01:13:25Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![jsoho](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/8baadc/32.png) [@jsoho](https://www.ruby-forum.com/u/jsoho)\
**Post date:** [October 24, 2009, 1:13am UTC](https://www.ruby-forum.com/t/code-review-silverlight-fixes/177805/1 "2009-10-24T01:13:25Z")

</div>

Here’s a bunch of Silverlight fixes, mainly related to porting gestalt  
to Microsoft.Scripting.Silverlight. Here are some live demos:  
[http://ironruby.com/gestalt](http://ironruby.com/gestalt). I also fixed a pretty annoying tutorial  
scrolling bug, which is also fixed on [http://ironruby.net/tutorial](http://ironruby.net/tutorial). This  
review is mainly FYI only as it only affects Silverlight, so Jim is  
pulling this in shortly, but feel free to comment if something stands  
out.

- 

```
    Initial Ruby project scripts: get all closed/fixed work-items 

```

since a specific  
date.[http://github.com/jschementi/ironruby/commit/495c96be7224fb72e167a56f666156357b296f32](http://github.com/jschementi/ironruby/commit/495c96be7224fb72e167a56f666156357b296f32)

- 

```
    Fix various powershell 

```

aliases[http://github.com/jschementi/ironruby/commit/d2609ccfe1301ad9f1309c92aeb43600b1101533](http://github.com/jschementi/ironruby/commit/d2609ccfe1301ad9f1309c92aeb43600b1101533)

- 

```
    port gestalt "_units" and fixes 

```

bugs.[http://github.com/jschementi/ironruby/commit/9224afb2fb92f66969b169a48ed339fe97d4d3a2](http://github.com/jschementi/ironruby/commit/9224afb2fb92f66969b169a48ed339fe97d4d3a2)

o make sure visible Silverlight controls created from a XAML script  
tag are added to the DOM directly next to a script tag.

o temporary work-around for HTML property setters.

o Make sure DLR.settings are taken into account when generating  
Silverlight controls for XAML script tags

- 

```
    Make sure script-tags are executed in order, regardless of 

```

their mime-type, inline or  
external.[http://github.com/jschementi/ironruby/commit/bd0ccb8ca38db9d11d68e88a0f83d904c1eb6d6f](http://github.com/jschementi/ironruby/commit/bd0ccb8ca38db9d11d68e88a0f83d904c1eb6d6f)

o Execute all inline scripts in one scope, and execute each external  
script in its own scope.

o Adds DynamicEngine.CreateScope() to populate helper variables on a  
new scope.

o Add a test for ensuring Silverlight controls are added as immediate  
siblings of XAML script-tags

- 

```
    Fix HttpVirtualFilesystem.GetFileInternal to use Path.Combine 

```

to join baseUri and relativeUri, rather than just concatinating them,  
rename DLR.createObject to DLR.createSilverlightObject, and update  
Silverlight build aliases to the latest  
version.[http://github.com/jschementi/ironruby/commit/5105df739c8f89864e97e9cdc8ed0ae457779fdb](http://github.com/jschementi/ironruby/commit/5105df739c8f89864e97e9cdc8ed0ae457779fdb)

- 

```
    Make sure a copy of Silverlight in this repo is ignored, and 

```

various script  
tweaks[http://github.com/jschementi/ironruby/commit/28993d777046f9d8d860860b329dc705fcfda361](http://github.com/jschementi/ironruby/commit/28993d777046f9d8d860860b329dc705fcfda361)

- 

```
    DynamicApplication.MakeUri - makes a Uri relative to whatever 

```

makes sense at the time (HTML page or entry-point  
script)[http://github.com/jschementi/ironruby/commit/5f233c794d51508b01673b26bae4c294e468705d](http://github.com/jschementi/ironruby/commit/5f233c794d51508b01673b26bae4c294e468705d)

o Unify all Uri-handling routines to use MakeUri

o Add DynamicEngine.RunningEntryPoint and  
DynamicScriptTags.RunningScriptTags – flags which return true if the  
respective type of code is running at the moment, false otherwise.

o Make sure DynamicEngine.Run is always referring to the entryPoint  
argument.

o DynamicApplication.BaseUri is the Uri MakeUri always tries to be  
relative against.

o Don’t try to run script-tag code if it’s neither inline or external  
(duh).

o Make DynamicApplication.LoadComponent and MakeUri static methods

o Add BrowserVirtualFilesystem.Normalize(string) as a static method

o Fix gestalt samples to use MakeUri

o Rename Cache to DownloadCache

- 

```
    Various Silverlight 

```

tweaks[http://github.com/jschementi/ironruby/commit/c059caa38a728064cc7684aa252d5d3656128ce2](http://github.com/jschementi/ironruby/commit/c059caa38a728064cc7684aa252d5d3656128ce2)

o Load “init.\*” files (from assembly resources) before any other code  
runs, for language-specific monkey-patching, and remove previous  
DynamicObject implementation.

o XapVirtualFilesystem checks for a file as a assembly resource if it  
the file is not in the XAP.

o Make following public: DynamicApplication.BaseUri,  
BrowserPAL.VirtualFilesystem, and  
DynamicLanguageConfig.GetLanguageByName.

o DLR.createSilverlightObject now always takes a pre-parsed set of  
options, while DLR.\_\_createSilverlightObject takes already-parsed  
options.

o dlr.js tests should remove any added silverlight controls so load  
time isn’t slowed down.

o Added BrowserVirtualFilesystem and Ruby extension tests.

o Local deploy scripts for Ruby Tutorial and Silverlight samples.

- 

```
    DLR.createSilverlightObject should use DLR.settings, so 

```

user-defined defaults are used for all  
controls.[http://github.com/jschementi/ironruby/commit/7164dbf851b40bf2775433d6d286530a57d64a2f](http://github.com/jschementi/ironruby/commit/7164dbf851b40bf2775433d6d286530a57d64a2f)

o Also fix sample batch files to work from any current directory.

- 

```
    Remove files from Tutorial which should not be checked 

```

in[http://github.com/jschementi/ironruby/commit/c01d5e2afcf4b31ec3d98a6602ade18c325458fe](http://github.com/jschementi/ironruby/commit/c01d5e2afcf4b31ec3d98a6602ade18c325458fe)

- 

```
    Cleans up LoadRootVisual and 

```

LoadComponent[http://github.com/jschementi/ironruby/commit/c47b4d9195a2e43c6f45e6fc1e219b7cc784530a](http://github.com/jschementi/ironruby/commit/c47b4d9195a2e43c6f45e6fc1e219b7cc784530a)

- 

```
    Clean up Silverlight 

```

sample-scripts[http://github.com/jschementi/ironruby/commit/64b6cd6baeb9d34599a82dc9b0c10dc9759a3f8f](http://github.com/jschementi/ironruby/commit/64b6cd6baeb9d34599a82dc9b0c10dc9759a3f8f)

- 

```
    Cleanup IronRuby tutorial 

```

scripts[http://github.com/jschementi/ironruby/commit/fb49e02bc27cbd357bc30994943624c1ea0b0175](http://github.com/jschementi/ironruby/commit/fb49e02bc27cbd357bc30994943624c1ea0b0175)

- 

```
    IronRuby tutorial - allow "silverlight" method to be used in 

```

chapters as  
well.[http://github.com/jschementi/ironruby/commit/36ad18639ac7b49d26ad029764190aca6e81f530](http://github.com/jschementi/ironruby/commit/36ad18639ac7b49d26ad029764190aca6e81f530)

- 

```
    Get IronRuby tutorial tests running in Silverlight again, and 

```

only show the console when running  
tests.[http://github.com/jschementi/ironruby/commit/c96b1551effae5677b6b04812ecf490296dad4e3](http://github.com/jschementi/ironruby/commit/c96b1551effae5677b6b04812ecf490296dad4e3)

- 

```
    Woops, forgot to actually disable the test in 

```

Silverlight[http://github.com/jschementi/ironruby/commit/6e88d3b204f6643aa0b031b8a76d6179d398307f](http://github.com/jschementi/ironruby/commit/6e88d3b204f6643aa0b031b8a76d6179d398307f)

- 

```
    Fix IronRuby tutorial scrolling bug, and clean up TryRuby 

```

tutorial a  
bit[http://github.com/jschementi/ironruby/commit/f5ff502f229211a0dbfd8412b43ac814fd2ff3ec](http://github.com/jschementi/ironruby/commit/f5ff502f229211a0dbfd8412b43ac814fd2ff3ec)

~Jimmy
