예제 #1
0
        public void AddShapeToGroup(int shapeId, int groupId)
        {
            IShape shapeToAdd = GetShapeById(shapeId);

            if (shapeToAdd != null)
            {
                GroupShapes group = (GroupShapes)GetShapeById(groupId);
                group.AddToGroup(shapeToAdd);
                shapesOnCanvas.Remove(shapeToAdd);
            }
        }
예제 #2
0
        public void AddAction(object sender, object contextObject)
        {
            GroupShapes group = (GroupShapes)contextObject;

            Console.WriteLine("Id of the group: ");
            group.Identifier = Int32.Parse(Console.ReadLine());

            Console.WriteLine("Insert the id of shape: ");
            int id = Int32.Parse(Console.ReadLine());

            canvas.AddShapeToGroup(id, group.Identifier);
        }
예제 #3
0
        public void GroupAction(object sender, object contextObject)
        {
            //GroupShapes group = (GroupShapes)contextObject;
            GroupShapes group = new GroupShapes();

            Console.WriteLine("Group name:");
            group.GroupName = Console.ReadLine();

            canvas.AddShape(group);
            Console.WriteLine("Shapes on canvas:");
            canvas.DrawShapes();
            Console.ReadKey();
        }