The goog.silverlight Namespace

The goog.silverlight.ClipboardButton Class

A button that can access the native clipboard, via Silverlight. If this is not a browser that supports native clipboard access, throw an error. Clients should not instantiate this directly. Instead, use CopyButton or PasteButton. … more

The goog.silverlight.ClipboardEvent Class

A clipboard button event. By design, replicates IE's clipboard API. … more

The goog.silverlight.ClipboardEventType Enum

… more

The goog.silverlight.CopyButton Class

A button that can copy contents. … more

The goog.silverlight.PasteButton Class

A button that can retrieve contents from the native clipboard. … more

.PasteButtonEvent

.__cleanup()

Releases event handler resources when the page is unloaded

.__installationEventFired {boolean}

Ensures that only one Installation State event is fired.

.__onSilverlightInstalledCalled {boolean}

Prevents onSilverlightInstalled from being called multiple times

.__verifySilverlight2UpgradeSuccess(host)

This internal function helps identify installation state by taking advantage of behavioral differences between the 1.0 and 2.0 releases of goog.silverlight.

host {SilverlightPlugin}
The dep object.
returns {boolean}
If verification succeeded.

._silverlightCount {number}

Counter of globalized event handlers

.buildHtml(slProperties)

Create HTML that instantiates the control

slProperties {Object}
The properties of the object.
returns {string}
The HTML for the object.

.buildPromptHtml(slPluginHelper)

Builds the HTML to prompt the user to download and install Silverlight

slPluginHelper {{version: string, alt: string}}
Alt is an alternate link to silverlight. If no alternate is specified, a default will be used with the given version number.
returns {string}
The UI.

.createObject(source, parentElement, opt_id, opt_properties, opt_events, opt_initParams, opt_userContext)

Inserts a Silverlight tag or installation experience into the HTML DOM based on the current installed state of goog.silverlight.
source {string}
The source file.
parentElement {Element}
The place to render the tag.
opt_id {(string|null)=}
A DOM id for the tag.
opt_properties {Object=}
Properties for the tag. One of these should be version, to get the correct version of silverlight.
opt_events {Array.<Function>=}
An array of functions, keyed by the name of the event that they should be listening on (e.g., "onload"). What a weird API. The keys should be quoted if you're compiling with property renaming on.
opt_initParams {string=}
The initParams property of SilverlightPlugin.
opt_userContext {Object=}
Context to fire the events in. doesn't really work correctly. Use goog.bind instead.
returns {?string}
The html for the object, if no rendering parent was specified.

.createObjectEx(params)

takes a single parameter of all createObject parameters enclosed in {}

params {{source: string, parentElement: Element, id: string, properties: Object, events: Array.<Function>, initParams: string, context: Object}}
Named parameters of createObject.
returns {?string}
See #createObject.

.defaultErrorHandler(sender, args)

Default error handling function

sender {SilverlightDependencyObject}
dep object.
args {SilverlightErrorEventArgs}
The event.

.disposeHandlerName(handlerName)

Frees a handler created by getHandlerName.

handlerName {string}
A handler name.

Navigates to a url based on fwlinkid

linkid {string}
The link suffix.

.fwlinkRoot {string}

Prefix for fwlink URL's

.getHandlerName(handler)

Generates named event handlers for delegates. Attaches them to the global window with the name __closure_slEvent + a unique id.

handler {Function|string}
A function to export.
returns {?string}
The name of the handler.

.getSilverlight(version)

Navigates the browser to the appropriate Silverlight installer

version {string}
The silverlight version.

.htmlAttributeEncode(strInput)

Encodes special characters in input strings as charcodes

strInput {?string}
String to encode, or null. If null is passed, we give null right back.
returns {?string}
The encoded string, or null.

.isInstalled(version)

Checks to see if the correct version is installed.

version {?string=}
The silverlight version.
returns {boolean}
Whether silverlight is installed.

.isVersionAvailableOnError(sender, args)

This function should be called at the beginning of a web page's Silverlight error handler. It will determine if the required version of Silverlight is installed and available in the current process. During its execution the function will trigger one of the Silverlight installation state events, if appropriate. Sender and Args should be passed through from the calling onError handler's parameters. The associated Sivlerlight tag must have minRuntimeVersion set and should have autoUpgrade set to false.
sender {SilverlightDependencyObject}
The sender.
args {SilverlightErrorEventArgs}
The event arguments.
returns {boolean}
Is the version available?

.isVersionAvailableOnLoad(sender)

This function should be called at the beginning of a web page's Silverlight onLoad handler. It will determine if the required version of Silverlight is installed and available in the current process. During its execution the function will trigger one of the Silverlight installation state events, if appropriate. Sender should be passed through from the calling onError handler's parameters. The associated Sivlerlight tag must have minRuntimeVersion set and should have autoUpgrade set to false.
sender {SilverlightDependencyObject}
The dep object.
returns {boolean}
Is the version available?

.onGetSilverlight {Function}

Called by goog.silverlight.getSilverlight to notify the page that a user has requested the Silverlight installer

.onInstallRequired()

Called by goog.silverlight.checkInstallStatus to notify the page that Silverlight has not been installed by this user. The page should respond by injecting a clear, visible, and actionable upgrade message into the DOM. The message must inform the user that they need to download and install components needed to use the page. Silverlight should be mentioned so the user expects to see that string in the installer UI. However, the Silverlight-powered application should be the focus of the solicitation. The user wants the app. Silverlight is a means to the app. The installation solicitation will have a button that directs the user to the Silverlight installer. Upon click the button should both kick off a download of the installer URL and replace the Upgrade text with "Thanks for downloading. When installation is complete you may need to refresh the page to view this content" or equivalent.

.onRequiredVersionAvailable()

Called by version verification control to notify the page that an appropriate build of Silverlight is available. The page should respond by injecting the appropriate Silverlight control

.onRestartRequired()

Called by version verification control to notify the page that an appropriate build of Silverlight is installed but not loaded. The page should respond by injecting a clear and visible "Thanks for installing. Please restart your browser and return to mysite.com" or equivalent into the browser DOM

.onSilverlightInstalled()

Called by Silverlight.waitForInstallCompletion when the page detects that Silverlight has been installed. The event handler is not called in upgrade scenarios.

.onUpgradeRequired()

Called by version verification control to notify the page that Silverlight must be upgraded. The page should respond by injecting a clear, visible, and actionable upgrade message into the DOM. The message must inform the user that they need to upgrade Silverlight to use the page. They are already somewhat familiar with the Silverlight product when they encounter this. Silverlight should be mentioned so the user expects to see that string in the installer UI. However, the Silverlight-powered application should be the focus of the solicitation. The user wants the app. Silverlight is a means to the app. The upgrade solicitation will have a button that directs the user to the Silverlight installer. Upon click the button should both kick off a download of the installer URL and replace the Upgrade text with "Thanks for downloading. When the upgarde is complete please restart your browser and return to mysite.com" or equivalent. Note: For a more interesting upgrade UX we can use Silverlight 1.0-style XAML for this upgrade experience. Contact PiotrP for details.

.startup()

Performs startup tasks.

.supportedUserAgent(version, userAgent)

NOTE: This function is strongly tied to current implementations of web browsers. The implementation of this function will change over time to account for new Web browser developments. Visit http://code.msdn.microsoft.com/SLsupportedUA often to ensure that you have the latest version. Determines if the client browser is supported by Silverlight.

version {string}
determines if a particular version of Silverlight supports this browser. Acceptable values are "1.0" and "2.0".
userAgent {string=}
optional. User Agent string to be analized. If null then the current browsers user agent string will be used.
returns {boolean}
Whether the user agent is supported.

.waitForInstallCompletion()

Occasionally checks for Silverlight installation status. If it detects that Silverlight has been installed then it calls Silverlight.onSilverlightInstalled();. This is only supported if Silverlight was not previously installed on this computer.