Exemplo n.º 1
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);
            }
        }
Exemplo n.º 2
0
        private void CreateNesting()
        {
            INestable      parent = first.Entity as INestable;
            INestableChild child  = second.Entity as INestableChild;

            try
            {
                if (parent == null)
                {
                    throw new RelationshipException(Strings.ErrorParentNestingNotSupported);
                }

                if (child == null)
                {
                    throw new RelationshipException(Strings.ErrorChildNestingNotSupported);
                }

                diagram.AddNesting(parent, child);
            }
            catch (RelationshipException ex)
            {
                MessageBox.Show(Strings.ErrorCannotCreateRelationship + " " + ex.Message);
            }
        }