Пример #1
0
 /// <summary>
 /// Alerts listeners that the shape has been assigned as a child shape to a parent shape.
 /// </summary>
 public override void OnShapeInserted()
 {
     base.OnShapeInserted();
     using (Transaction transaction = Store.TransactionManager.BeginTransaction("Adjust size"))
     {
         ShapeHelper.ResizeToContent(this);
         IsExpanded = false;
         transaction.Commit();
     }
 }
Пример #2
0
        /// <summary>
        /// Alerts listeners when the mouse is double-clicked over the shape.
        /// </summary>
        /// <param name="e">The diagram point event arguments.</param>
        public override void OnDoubleClick(DiagramPointEventArgs e)
        {
            base.OnDoubleClick(e);

            using (Transaction transaction = Store.TransactionManager.BeginTransaction("Adjust size"))
            {
                ShapeHelper.ResizeToContent(this);
                transaction.Commit();
            }
        }
Пример #3
0
 /// <summary>
 /// Alerts listeners that the shape has been assigned as a child shape to a parent shape.
 /// </summary>
 public override void OnShapeInserted()
 {
     base.OnShapeInserted();
     if (!Store.InUndoRedoOrRollback)
     {
         using (Transaction transaction = Store.TransactionManager.BeginTransaction("Adjust size"))
         {
             ShapeHelper.ResizeToContent(this);
             transaction.Commit();
         }
     }
 }
Пример #4
0
        /// <summary>
        /// Alerts listeners when the mouse is double-clicked over the shape.
        /// </summary>
        /// <param name="e">The diagram point event arguments.</param>
        public override void OnDoubleClick(DiagramPointEventArgs e)
        {
            base.OnDoubleClick(e);

            if (Utils.IsKeyPressed(Keys.Shift))
            {
                using (Transaction transaction = Store.TransactionManager.BeginTransaction("Adjust size"))
                {
                    ShapeHelper.ResizeToContent(this);
                    transaction.Commit();
                }
                return;
            }

            Entity entity = ModelElement as Entity;

            if (entity != null)
            {
                Mapper.Instance.ShowCode(entity.Id, entity.Name, null);
            }
        }
Пример #5
0
        /// <summary>
        /// Alerts listeners when the mouse is double-clicked over the shape.
        /// </summary>
        /// <param name="e">The diagram point event arguments.</param>
        public override void OnDoubleClick(DiagramPointEventArgs e)
        {
            base.OnDoubleClick(e);

            // Avec shift = AdjustSize
            if (Utils.IsKeyPressed(Keys.Shift))
            {
                using (Transaction transaction = Store.TransactionManager.BeginTransaction("Adjust size"))
                {
                    ShapeHelper.ResizeToContent(this);
                    transaction.Commit();
                }
                return;
            }

            ClassImplementation clazz = ModelElement as ClassImplementation;

            if (clazz != null)
            {
                Mapper.Instance.ShowCode(clazz.Id, clazz.Name, null);
            }
        }
Пример #6
0
 /// <summary>
 /// Arranges the shapes.
 /// </summary>
 public void ArrangeShapes()
 {
     ShapeHelper.ResizeToContent(this);
 }