コード例 #1
0
        public void SetProxy(IAopProxy target)
        {
            Shape2D shape = target as Shape2D;

            if (shape == null)
                throw new ArgumentException("target is not an IShape2D");

            this.shape = shape;
        }
コード例 #2
0
        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);
        }
コード例 #3
0
        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);
        }