Ejemplo n.º 1
0
        protected void BeginRenameType(UmlDesigner owner)
        {
            var inputBounds = new Rectangle(Bounds.Left + Margins.typeBoxSideMargin, Bounds.Top + 4,
                                            Bounds.Width - 25 - Margins.typeBoxSideMargin, 20);

            Action endRenameType = () => { DataSource.TypeName = owner.GetInput(); };

            owner.BeginInput(inputBounds, DataSource.TypeName, Fonts.DefaultTypeName, endRenameType);
        }
Ejemplo n.º 2
0
        private void BeginRenameProperty(UmlDesigner owner, UmlTypeMember property)
        {
            Rectangle bounds = owner.GetItemBounds(property);
            if (bounds == Rectangle.Empty)
                bounds = owner.GetItemBounds(AddNewPropertyIdentifier);

            var inputBounds = new Rectangle(bounds.X + Margins.TypeMemberNameIndent, bounds.Y,
                                            bounds.Width - Margins.TypeMemberNameIndent, bounds.Height);
            object oldSelectedObject = SelectedObject;
            SelectedObject = null;
            Action endRenameProperty = () =>
                                       {
                                           property.DataSource.Name = owner.GetInput();
                                           if (property.DataSource.Name == "")
                                           {
                                               SelectedObject = property;
                                               DeleteSelectedMember();
                                           }
                                           else
                                           {
                                               SelectedObject = oldSelectedObject;
                                           }
                                       };

            Font font = GetTypeMemberFont();
            owner.BeginInput(inputBounds, property.DataSource.Name, font, endRenameProperty);
        }
Ejemplo n.º 3
0
        private void BeginEditText(UmlDesigner owner)
        {
            Rectangle inputBounds = Bounds;
            inputBounds.Inflate(-10, -10);

            Action endEditText = () => { DataSource.Text = owner.GetInput(); };

            owner.BeginInputMultiLine(inputBounds, DataSource.Text, Fonts.CommentText, endEditText);
        }