//---------------------------------------------------------- // Copyright (C) Microsoft Corporation. All rights reserved. //---------------------------------------------------------- // SilverlightControl.js Type.registerNamespace("Sys.UI.Silverlight");Sys.UI.Silverlight.Control=function(a){Sys.UI.Silverlight.Control.initializeBase(this,[this._findObject(a)||a]);this._scaleMode=Sys.UI.Silverlight.ScaleMode.none};Sys.UI.Silverlight.Control.prototype={_source:null,_loaded:false,_boundEvents:null,_setOnLoad:false,_setOnFullScreenChange:false,_setOnResize:false,_setOnError:false,add_pluginError:function(a){this.get_events().addHandler("pluginError",a)},remove_pluginError:function(a){this.get_events().removeHandler("pluginError",a)},add_pluginFullScreenChanged:function(a){this.get_events().addHandler("pluginFullScreenChanged",a)},remove_pluginFullScreenChanged:function(a){this.get_events().removeHandler("pluginFullScreenChanged",a)},add_pluginLoaded:function(a){this.get_events().addHandler("pluginLoaded",a)},remove_pluginLoaded:function(a){this.get_events().removeHandler("pluginLoaded",a)},add_pluginResized:function(a){this.get_events().addHandler("pluginResized",a)},remove_pluginResized:function(a){this.get_events().removeHandler("pluginResized",a)},get_scaleMode:function(){return this._scaleMode},set_scaleMode:function(a){if(a!==this.get_scaleMode()){this._scaleMode=a;if(this._loaded)this._ensureTransform()}},get_source:function(){return this._source||""},set_source:function(a){this._source=a;if(a&&this._setOnLoad)this.get_element().Source=a},addEventListener:function(b,a,e){var d=b.addEventListener(a,e),c=this._getEventsForElement(b,true);c[c.length]={eventName:a,token:d};return d},dispose:function(){if(this._loaded){this.pluginDispose();this._loaded=false}var a=this.get_element();if(a){if(this._setOnLoad)a.OnLoad=null;if(this._setOnError)a.OnError=null;if(this._setOnFullScreenChange)a.content.OnFullScreenChange=null;if(this._setOnResize)a.content.OnResize=null}var b=this._boundEvents;if(b){for(var c=0,i=b.length;c');var c={horizontal:a.Matrix.M11,vertical:a.Matrix.M22};a.Matrix.M11=f;a.Matrix.M22=g;a.Matrix.OffsetX=d;a.Matrix.OffsetY=e;return c};Sys.UI.Silverlight.Control.createObject=function(a,b){document.getElementById(a).innerHTML=b};Sys.UI.Silverlight.Control.registerClass("Sys.UI.Silverlight.Control",Sys.UI.Control);Sys.UI.Silverlight.ErrorEventArgs=function(a){this._error=a;Sys.UI.Silverlight.ErrorEventArgs.initializeBase(this)};Sys.UI.Silverlight.ErrorEventArgs.prototype={get_error:function(){return this._error}};Sys.UI.Silverlight.ErrorEventArgs.registerClass("Sys.UI.Silverlight.ErrorEventArgs",Sys.CancelEventArgs);Sys.UI.Silverlight.ScaleMode=function(){throw Error.notImplemented()};Sys.UI.Silverlight.ScaleMode.prototype={none:0,zoom:1,stretch:2};Sys.UI.Silverlight.ScaleMode.registerEnum("Sys.UI.Silverlight.ScaleMode");