//>>built
define("dojox/drawing/plugins/drawing/Silverlight",["dijit","dojo","dojox"],function(n,c,h){c.provide("dojox.drawing.plugins.drawing.Silverlight");h.drawing.plugins.drawing.Silverlight=h.drawing.util.oo.declare(function(f){"silverlight"==h.gfx.renderer&&(this.mouse=f.mouse,this.stencils=f.stencils,this.anchors=f.anchors,this.canvas=f.canvas,this.util=f.util,c.connect(this.stencils,"register",this,function(a){var b,d=this;(function(){b=a.container.connect("onmousedown",function(l){l.superTarget=a;
d.mouse.down(l)})})();var g=c.connect(a,"setTransform",this,function(){});var e=c.connect(a,"onBeforeRender",function(){});var k=c.connect(a,"onRender",this,function(){});var m=c.connect(a,"destroy",this,function(){c.forEach([b,g,e,k,m],c.disconnect,c)})}),c.connect(this.anchors,"onAddAnchor",this,function(a){var b=a.shape.connect("onmousedown",this.mouse,function(g){g.superTarget=a;this.down(g)}),d=c.connect(a,"disconnectMouse",this,function(){c.disconnect(b);c.disconnect(d)})}),this.mouse._down=
function(a){var b=this._getXY(a),d=b.x-this.origin.x;b=b.y-this.origin.y;d*=this.zoom;b*=this.zoom;this.origin.startx=d;this.origin.starty=b;this._lastx=d;this._lasty=b;this.drawingType=this.util.attr(a,"drawingType")||"";a=this._getId(a);d={x:d,y:b,id:a};this.onDown(d);this._clickTime=(new Date).getTime();this._lastClickTime&&this._clickTime-this._lastClickTime<this.doublClickSpeed&&(a=this.eventName("doubleClick"),this._broadcastEvent(a,d));this._lastClickTime=this._clickTime},this.mouse.down=function(a){clearTimeout(this.__downInv);
"surface"==this.util.attr(a,"drawingType")?this.__downInv=setTimeout(c.hitch(this,function(){this._down(a)}),500):this._down(a)},this.mouse._getXY=function(a){if(a.pageX)return{x:a.pageX,y:a.pageY,cancelBubble:!0};for(var b in a);return void 0!==a.x?{x:a.x+this.origin.x,y:a.y+this.origin.y}:{x:a.pageX,y:a.pageY}},this.mouse._getId=function(a){return this.util.attr(a,"id")},this.util.attr=function(a,b,d,g){if(!a)return!1;try{var e=a.superTarget?a.superTarget:a.superClass?a.superClass:a.target?a.target:
a;if(void 0!==d)return a[b]=d;if(e.tagName){if("drawingType"==b&&"object"==e.tagName.toLowerCase())return"surface";var k=c.attr(e,b)}return k=e[b]}catch(m){return!1}})},{})});