Script# Runtime and Framework

This page describes the Script# Runtime that the compiler depends on as well as the optional Script# Framework.

Any project that is built using Script# must reference the Script# runtime. The Script# Framework on the other hand is optional. They are composed of several assemblies that you include as references when building your Ajax application or component or your own framework. These get you started quickly by providing APIs that allow you to reference the DOM and other existing scriptable APIs.

Script# Runtime

The type system and base class library are represented by the sscorlib.dll assembly and its corresponding sscorlib.js script file. These must be referenced in all code compiled using Script#. This core script library contains extensions to the standard JavaScript objects such as Function, Array, String, Number, etc. as well as a small number of new types.

The type system simulates key OOP constructs to provide structure to the generated code that mimics the original C# source code. The OOP constructs include namespaces, classes, interfaces, enumerations, and delegates. The implementation allows runtime inspection of types to retrieve type names, base classes, checking for the existence of an interface implementation etc. The type system uses the prototype feature of JavaScript to define classes.

The base class library is partly implemented by extending the prototype of key objects such as Array, String, Number, Date etc. to provide an API that is consistent to the .NET equivalents, as well as API that is useful in the scripting environment that is beyond that available in .NET. The base class library also provides some new types such as StringBuilder, CultureInfo, Debug etc. and capabilities such as string formatting that simplify various aspects of script authoring.

Script# Framework

The Script# Framework provides a script library that was itself coded in C# and converted to script using Script#.

Core Programming Model, Networking, and UI Concepts - ssfx.Core.dll
This assembly provides the core programming model in the ScriptFX namespace, which consists of an Application class and related services such as dispose mechanism, history management, session state, idle task execution, and script loading. It also consists of generally useful utility classes to manage event handlers, perform JSON serialization, detect browser and host information etc.
The ScriptFX.Net namespace provides a higher-level HTTP-based networking stack with HTTPRequest/HTTPResponse classes with useful features such as timeouts, request building, scheduled execution, custom caching, and monitoring hooks via a centralized HTTPRequestManager etc. It provides an extensible model for plugging in different transports (such as XMLHttp) to perform actual invocation of network requests.
The ScriptFX.UI namespace provides the core infrastructure classes to associate script-based logic with DOM elements. Specifically it introduces the notion of Controls and Behaviors. In addition it defines core interface contracts for some UI elements. It provides a high-performance extensible animation core that can be used to incorporate visual glitz into an application. In the future this will consist of other core UI infrastructure and services such as templating and drag/drop.

Cross-Domain AJAX using JSONP - ssfx.XDAjax.dll
This assembly provides the implementation of an alternate HTTPTransport in the ScriptFX.Net namespace that can be plugged in into the networking system to enable cross-domain requests performed using script tags and the JSONP protocol.

UI Controls and Behaviors - ssfx.UI.Forms.dll
This assembly provides the implementation of commonly used controls and behaviors when implementing forms in Web pages. This includes controls like TextBox, Button etc. as well as higher level features such a rich AutoComplete behavior, Watermark behavior that can be attached to input textboxes. In the future, this assembly will provide features such as validation, calendar controls etc.

Reflection Utility - ssfx.Reflection.dll
This assembly provides higher-level .NET-like reflection functionality in the ScriptFX.Reflection namespace in order to enumerate namespaces, types, and members. This can be used to implement class-browsing scenarios and applications.

Microsoft Silverlight XAML DOM - ssagctrl.dll
This assembly provides APIs to program against the Microsoft Silverlight control within the browser. Specifically it allows programming against the XAML DOM to enable AJAX applications to make use of scriptable vector graphics, media and animations that are offered by the Silverlight control.

Microsoft Virtual Earth APIs - ssve4.dll
This assembly provides APIs that map to v4 of the Microsoft Virtual Earth Map Control. The map control is an existing script library, and this assembly simply provides metadata so that it may be used from C# and compilation with Script#.

Windows Vista Sidebar Gadgets - ssgadgets.dll
This assembly enables programming against the scriptable APIs that can be used to develop gadgets that run within Microsoft Windows Vista Sidebar.

File System APIs - ssfso.dll
This assembly provides a metadata assembly that enables using the FileSystem Scripting Object available to trusted script applications on Microsoft Windows. Trusted script applications include gadgets. Typically browser-based applications are not trusted. This API allows trusted applications to work against files and folders, as well as read and write local files.

RSS Feeds - ssfeeds.dll
This assembly provides a metadata assembly that enables programming against the user’s RSS store introduced in Internet Explorer 7.0. Like the file system APIs listed above, this API is only available outside the Web browser to trusted applications such as gadgets. This API allows subscribing/unsubscribing to RSS feeds, and access the data present in the user’s RSS feeds.

Naming Convention
You may have noticed a naming convention at play. Indeed there is a pattern. All the assemblies named ssfx*.dll represent framework implementations in script (that were compiled using Script# of course). All the other ss*.dll assemblies represent existing script APIs or scriptable APIs that have been imported.

Google
   

Script#

Script# compiles C# source code into JavaScript and brings the power and productivity of C# and .NET tools to Ajax development.

Latest Release (Version 0.5.0.0)