public void SetProxy(IAopProxy target) { Shape2D shape = target as Shape2D; if (shape == null) throw new ArgumentException("target is not an IShape2D"); this.shape = shape; }
public void SetProxy(IAopProxy target) { Shape2D shape = target as Shape2D; if (shape == null) throw new ArgumentException("target is not an IShape2D"); this.shape = shape; this.selectable = (ISelectable)shape; IMouseHandler mouseShape = (IMouseHandler)shape; mouseShape.MouseDownHandlers.Add(MouseDown); mouseShape.MouseUpHandlers.Add(MouseUp); mouseShape.MouseMoveHandlers.Add(MouseMove); }
public void SetProxy(IAopProxy target) { Shape2D shape = target as Shape2D; if (shape == null) throw new ArgumentException("target is not an IShape2D"); this.shape = shape; ResizableAttribute attrib = (ResizableAttribute)shape.GetType().GetCustomAttributes(typeof(ResizableAttribute), true)[0]; KeepProportions = attrib.KeepProportions; IMouseHandler mouseShape = (IMouseHandler)shape; mouseShape.MouseDownHandlers.Add(MouseDown); mouseShape.MouseUpHandlers.Add(MouseUp); mouseShape.MouseMoveHandlers.Add(MouseMove); }