コード例 #1
0
        // Fill list from selection
        private void FillList(GraphicsList graphicsList, ref List<DrawObject> listToFill)
        {
            listToFill = new List<DrawObject>();

            foreach (DrawObject o in graphicsList.Selection)
            {
                listToFill.Add(o.Clone());
            }
        }
コード例 #2
0
        // Replace objects in graphicsList with objects from list
        private void ReplaceObjects(GraphicsList graphicsList, List<DrawObject> list)
        {
            for (int i = 0; i < graphicsList.Count; i++)
            {
                DrawObject replacement = null;

                foreach (DrawObject o in list)
                {
                    if (o.ID ==
                        graphicsList[i].ID)
                    {
                        replacement = o;
                        break;
                    }
                }

                if (replacement != null)
                {
                    graphicsList.Replace(i, replacement);
                }
            }
        }
コード例 #3
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;
        }
コード例 #4
0
 public EditLayerService(GraphicsList CurrentList,Layer layer)
 {
     this.CurrentList = CurrentList;
 }