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); }
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; }
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; }
public UmlTypeMember CreateTypeMember(string sectionName) { var member = new UmlTypeMember(); var data = new DefaultUmlTypeMemberData(); data.SectionName = sectionName; member.DataSource = data; members.Add(member); return member; }
public UmlTypeMember CreateTypeMember(string sectionName) { var member = new UmlTypeMember(); var data = new DefaultUmlTypeMemberData(); data.SectionName = sectionName; member.DataSource = data; members.Add(member); return(member); }
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; }
public void RemoveTypeMember(UmlTypeMember property) { var pe = (TypeMemberElement) property.DataSource.DataObject; pe.Parent.RemoveChild(pe); typeMemberLookup.Remove(pe); }
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; }
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); }
public void RemoveTypeMember(UmlTypeMember property) { members.Remove(property); }
public void RemoveTypeMember(UmlTypeMember property) { members.Remove(property); }