Beispiel #1
0
        internal void Relocate(CompositeTypeShape shape)
        {
            Diagram diagram = shape.Diagram;

            if (diagram != null)
            {
                Rectangle record = shape.GetMemberRectangle(shape.ActiveMemberIndex);

                Point absolute = new Point(shape.Right, record.Top);
                Size  relative = new Size(( int )(absolute.X * diagram.Zoom) - diagram.Offset.X + MarginSize, ( int )(absolute.Y * diagram.Zoom) - diagram.Offset.Y);
                relative.Height -= (Height - ( int )(record.Height * diagram.Zoom)) / 2;

                Location = ParentLocation + relative;
            }
        }
Beispiel #2
0
        internal override void Init(DiagramElement element)
        {
            shape = (CompositeTypeShape)element;

            entities = new List <string>();

            entities.Add("(None)");

            entities.AddRange(shape.Diagram.Entities.Select(ent => ent.Name).ToList());

            cboManyToOne.SelectedIndexChanged -= cboManyToOne_SelectedIndexChanged;

            cboManyToOne.DataSource = entities;

            cboManyToOne.SelectedIndexChanged += cboManyToOne_SelectedIndexChanged;

            RefreshValues();
        }
Beispiel #3
0
        private void CreateNesting()
        {
            CompositeTypeShape shape1 = first as CompositeTypeShape;
            TypeShape          shape2 = second as TypeShape;

            if (shape1 != null && shape2 != null)
            {
                try
                {
                    diagram.AddNesting(shape1.CompositeType, shape2.TypeBase);
                }
                catch (RelationshipException)
                {
                    MessageBox.Show(Strings.ErrorCannotCreateRelationship);
                }
            }
            else
            {
                MessageBox.Show(Strings.ErrorCannotCreateRelationship);
            }
        }
Beispiel #4
0
        private void CreateGeneralization( )
        {
            CompositeTypeShape shape1 = first as CompositeTypeShape;
            CompositeTypeShape shape2 = second as CompositeTypeShape;

            if ((shape1 != null) && (shape2 != null))
            {
                try
                {
                    diagram.AddGeneralization(shape1.CompositeType, shape2.CompositeType);
                }
                catch (RelationshipException)
                {
                    MessageBox.Show(Strings.ErrorCannotCreateRelationship);
                }
            }
            else
            {
                MessageBox.Show(Strings.ErrorCannotCreateRelationship);
            }
        }
Beispiel #5
0
 internal override void Init(DiagramElement element)
 {
     shape = (CompositeTypeShape)element;
     RefreshToolAvailability();
     RefreshValues();
 }
Beispiel #6
0
 public InsertMemberCommand(CompositeTypeShape shape, MemberType memberType)
 {
     this.shape      = shape;
     this.memberType = memberType;
 }