コード例 #1
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);
        }
コード例 #2
0
ファイル: UmlClassData.cs プロジェクト: attila3453/alsing
        public UmlTypeMember CreateTypeMember(string sectionName)
        {
            var property = new UmlTypeMember();
            var data = new UmlTypeMemberData();
            if (sectionName == "Properties")
            {
                var pe = new PropertyElement();
                pe.Type = "string";
                pe.Name = "";
                data.Owner = pe;
                property.DataSource = data;

                typeMemberLookup.Add(pe, property);
                Owner.Type.AddChild(pe);
            }

            if (sectionName == "Methods")
            {
                var pe = new MethodElement();
                pe.Name = "";
                data.Owner = pe;
                property.DataSource = data;

                typeMemberLookup.Add(pe, property);
                Owner.Type.AddChild(pe);
            }

            return property;
        }
コード例 #3
0
        public override void OnMouseUp(ShapeMouseEventArgs args)
        {
            foreach (UmlTypeMemberSection section in TypeMemberSections)
            {
                if (args.BoundingBox.Data == section.AddNewIdentifier)
                {
                    UmlTypeMember newMember = TypedDataSource.CreateTypeMember(section.Name);
                    SelectedObject = newMember;
                    BeginRenameProperty(args.Sender, newMember);
                    args.Redraw = true;
                }
            }

            //if (args.BoundingBox.Data == AddNewPropertyIdentifier)
            //{
            //    UmlTypeMember newProperty = TypedDataSource.CreateTypeMember("Property");
            //    this.SelectedObject = newProperty;

            //    BeginRenameProperty(args.Sender, newProperty);

            //    args.Redraw = true;
            //}

            if (args.BoundingBox.Data == TypeExpanderIdentifier)
            {
                Expanded = !Expanded;
            }
            args.Redraw = true;
        }
コード例 #4
0
 public UmlTypeMember CreateTypeMember(string sectionName)
 {
     var member = new UmlTypeMember();
     var data = new DefaultUmlTypeMemberData();
     data.SectionName = sectionName;
     member.DataSource = data;
     members.Add(member);
     return member;
 }
コード例 #5
0
        public UmlTypeMember CreateTypeMember(string sectionName)
        {
            var member = new UmlTypeMember();
            var data   = new DefaultUmlTypeMemberData();

            data.SectionName  = sectionName;
            member.DataSource = data;
            members.Add(member);
            return(member);
        }
コード例 #6
0
ファイル: UmlEnumData.cs プロジェクト: attila3453/alsing
        public UmlTypeMember CreateTypeMember(string sectionName)
        {
            var enumValue = new UmlTypeMember();
            var data = new UmlTypeMemberData();
            var pe = new EnumValueElement();
            pe.Value = 0;
            pe.Name = "";
            data.Owner = pe;
            enumValue.DataSource = data;

            typeMemberLookup.Add(pe, enumValue);
            Owner.Type.AddChild(pe);

            return enumValue;
        }
コード例 #7
0
ファイル: UmlClassData.cs プロジェクト: attila3453/alsing
 public void RemoveTypeMember(UmlTypeMember property)
 {
     var pe = (TypeMemberElement) property.DataSource.DataObject;
     pe.Parent.RemoveChild(pe);
     typeMemberLookup.Remove(pe);
 }
コード例 #8
0
ファイル: UmlClassData.cs プロジェクト: attila3453/alsing
        private UmlTypeMember GetTypeMember(TypeMemberElement pe)
        {
            UmlTypeMember typeMember = null;
            if (typeMemberLookup.TryGetValue(pe, out typeMember))
            {
                return typeMember;
            }

            typeMember = new UmlTypeMember();
            var data = new UmlTypeMemberData();
            data.Owner = pe;
            typeMember.DataSource = data;

            typeMemberLookup.Add(pe, typeMember);

            return typeMember;
        }
コード例 #9
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);
        }
コード例 #10
0
 public void RemoveTypeMember(UmlTypeMember property)
 {
     members.Remove(property);
 }
コード例 #11
0
 public void RemoveTypeMember(UmlTypeMember property)
 {
     members.Remove(property);
 }