public void PasteSlidesFromClipboard()
        {
            DrawObject _drawobject = null;

            if (Clipboard.ContainsData("DCS.Draw.DrawRectangle"))
            {
                _drawobject = (DrawRectangle)Clipboard.GetData("DCS.Draw.DrawRectangle");
            }
            if (Clipboard.ContainsData("DCS.Draw.DrawLine"))
            {
                _drawobject = (DrawLine)Clipboard.GetData("DCS.Draw.DrawLine");
            }
            if (Clipboard.ContainsData("DCS.Draw.DrawText"))
            {
                _drawobject = (DrawText)Clipboard.GetData("DCS.Draw.DrawText");
            }

            if (_drawobject != null)
            {
                UnselectAll();
                _drawobject.Selected = true;
                _drawobject.Move(Cursor.Position.X, Cursor.Position.Y);
                _drawobject.oIndex = 1;
                Pages().ActivePageGraphicList.Add(_drawobject);
            }
        }
示例#2
0
        public int MoveService(DrawObject client,GraphicsList GList,Point Goal)
        {
            client.PretendToMoveStart(Goal.X, Goal.Y);
            foreach (DrawObject o in GList.graphicsList)
            {
                if (o == client)
                {
                    continue;

                }
                else
                {   //judge the point?if line judge point, if rectangle?
                    //we have two point list
                    ArrayList clientpoints = client.GetCriticalPointList();
                    ArrayList Servicepoints = o.GetCriticalPointList();

                    for (int i = 0; i < clientpoints.Count; i++)
                    {
                        for(int j=0;j<Servicepoints.Count;j++)
                        {
                            int result = JudgeVertical(((Point)clientpoints[i]), ((Point)Servicepoints[j]));
                            if (result>0)
                            {

                                client.PretendToMoveOver(Goal.X, Goal.Y);

                                if (result == 1)
                                {
                                    client.Move(((Point)Servicepoints[j]).X, Goal.Y);
                                    return 1;

                                }
                                else if (result == 2)
                                {
                                    client.Move(Goal.X, ((Point)Servicepoints[j]).Y);
                                    return 1;

                                }
                                else
                                {

                                }

                            }

                        }

                    }

                }

            }
            client.PretendToMoveOver(Goal.X, Goal.Y);
            //every object has his own relation algrithum critical point
            //otherobject
            //if havent relation
            client.Move(Goal.X, Goal.Y);
            //client origin move(Goal)
            //if haverelation
            //
            return 1;
        }