private void cachedRepository_ShapesUpdated(object sender, RepositoryShapesEventArgs e)
 {
     foreach (Shape shape in e.Shapes) {
         FilterShape filterShape = shape as FilterShape;
         if (filterShape != null) {
             _UpdateFilterPositionDataForFilter(filterShape);
         }
     }
 }
        private void cachedRepository_ShapesUpdated(object sender, RepositoryShapesEventArgs e)
        {
            var shapes = GraphicHelper.GetOnlyEntities(e.Shapes.ToList());
            if (shapes.Count == 0)
                return;

            if (shapes.Count > 1)
            {
                foreach (var shape in shapes)
                {
                    var refModel = tables.Single(t => t.Name == (string) shape.Tag);
                    refModel.ShapePlacementInfo.Location = new Point(shape.X, shape.Y);
                    refModel.ShapePlacementInfo.Size = new Size(shape.Width, shape.Height);
                }
                return;
            }

            var element = (EntitySymbol) e.Shapes.ElementAt(0);
            var newTitle = element.Text;
            var referencedModel = tables.Single(t => t.Name == (string) element.Tag);
            referencedModel.ShapePlacementInfo.Location = new Point(element.X, element.Y);
            referencedModel.ShapePlacementInfo.Size = new Size(element.Width, element.Height);

            var logicRelList = tables.SelectMany(t => t.References).Where(t => t.OriginalTable == element.Tag.ToString() || t.RefTable == element.Tag.ToString()).ToList();
            GraphicHelper.UpdateRelationshipLabels(logicRelList, tables);

            if (referencedModel.Name == newTitle)
                return;

            referencedModel.UserMapping.ClassName = newTitle;
            RefreshCode();
        }