What's in Script#

This page describes the Script# runtime, the various other runtime and ScriptFX assemblies and what gets installed by the Script# installer.

The Script# installer installs the Script# compiler, the core runtime, a set of other optional runtime assemblies and an optional ScriptFX script framework. It also installs a set of samples (packaged as Samples.zip within the c:\Program Files\nStuff\ScriptSharp folder), and a set of project templates to help you get started quickly.

Any Script# project must reference the core Script# runtime. The ScriptFX framework on the other hand is optional. For more context see, the topic on Understanding and Using Script#.

Script# Runtime

The OOP 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 assembly defines System.Object, other primitive types, and BCL functionality needed for C# development. The script file defines extensions to 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 such that it mimics the original C# source code. These OOP constructs include namespaces, classes, interfaces, enumerations and delegates. The implementation of these constructs in script facilitates runtime type discovery, type names, base types, checking for existence of an interface implementation etc. The Script# runtime uses the prototype feature of JavaScript to define classes.

Note that when you are building a script file that will run against Microsoft ASP.NET Ajax (i.e. using MicrosoftAjax.js), you will need to reference aacorlib.dll as the core runtime instead of sscorlib.dll. These two runtimes are mutually exclusive.

Other Optional Runtime Assemblies

There are a few other runtime assemblies (ss*.dll) that correspond to existing script APIs that might be useful depending on the scenarios.

Silverlight (ssagctrl.dll) - This assembly provides ready-to-reference APIs corresponding to the scriptable APIs exposed by the Silverlight 1.0 ActiveX control and browser plugin. Specifically it allows programming against the XAML DOM to enable Ajax applications to use scriptable vector graphics, media and animations.

Virtual Earth (ssve4.dll) - This assembly provides a wrapper that maps to the Virtual Earth Map Control (version 4).

Windows Vista Sidebar Gadgets (ssgadgets.dll) - This assembly enables programming gadgets against the scriptable APIs offered by the Sidebar.

File System APIs (ssfso.dll) - This assembly enables programming against the FileSystem Scripting Object that is available to trusted script on Microsoft Windows. Specifically it is interesting in the context of building gadgets that need to read/write files and work with the local file system directly from script.

RSS Feeds (ssfeeds.dll) - This assembly enables programming against the RSS store introduced in Internet Explorer 7. Like the file system APIs this is available to trusted script on Microsoft Windows and is interesting in the context of authoring gadgets.

ScriptFX Framework

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.


Google
   

Script#

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

Interesting Reads