Example #1
0
		public DragObject(ReportRootDesigner designer, Control dragControl, object hitTestObject, int initialX, int initialY)
		{
			m_designer = designer;
			m_dragControl = dragControl;
			m_hitObject = hitTestObject;
			m_initialX = initialX;
			m_initialY = initialY;
			m_mouseOffset = new Point(0, 0);
			m_screenOffset = new Point(0, 0);
			m_screenOffset = dragControl.PointToScreen(m_screenOffset);

			// The drag actually consists of all objects that are currently selected.
			//
			ISelectionService ss = designer.SelectionService;
			IDesignerHost host = designer.Host;

			m_dragShapes = new ArrayList();

			if (ss != null && host != null)
			{
				ICollection selectedObjects = ss.GetSelectedComponents();
				foreach(object o in selectedObjects)
				{
					IComponent comp = o as IComponent;
					if (comp != null)
					{
						ItemDesigner des = host.GetDesigner(comp) as ItemDesigner;
						if (des != null)
						{
							m_dragShapes.Add(des);
						}
					}
				}
			}
		}
Example #2
0
        public DragObject(ReportRootDesigner designer, Control dragControl, object hitTestObject, int initialX, int initialY)
        {
            m_designer     = designer;
            m_dragControl  = dragControl;
            m_hitObject    = hitTestObject;
            m_initialX     = initialX;
            m_initialY     = initialY;
            m_mouseOffset  = new Point(0, 0);
            m_screenOffset = new Point(0, 0);
            m_screenOffset = dragControl.PointToScreen(m_screenOffset);

            // The drag actually consists of all objects that are currently selected.
            //
            ISelectionService ss   = designer.SelectionService;
            IDesignerHost     host = designer.Host;

            m_dragShapes = new ArrayList();

            if (ss != null && host != null)
            {
                ICollection selectedObjects = ss.GetSelectedComponents();
                foreach (object o in selectedObjects)
                {
                    IComponent comp = o as IComponent;
                    if (comp != null)
                    {
                        ItemDesigner des = host.GetDesigner(comp) as ItemDesigner;
                        if (des != null)
                        {
                            m_dragShapes.Add(des);
                        }
                    }
                }
            }
        }