private void toolNewMethod_Click(object sender, EventArgs e) { var command = new AddNewMemberCommand(parent, p => p.AddMethod()); command.Execute(); diagram.TrackCommand(command); AddNewOperation(command.Member as Method); }
private void toolNewEvent_Click(object sender, EventArgs e) { if (parent.SupportsEvents) { var command = new AddNewMemberCommand(parent, p => p.AddEvent()); command.Execute(); diagram.TrackCommand(command); AddNewOperation(command.Member as Event); } }
private void toolNewField_Click(object sender, EventArgs e) { if (parent.SupportsFields) { var command = new AddNewMemberCommand(parent, p => p.AddField()); command.Execute(); diagram.TrackCommand(command); AddNewField(command.Member as Field); } }
private void toolNewDestructor_Click(object sender, EventArgs e) { if (parent.SupportsDestructors) { var command = new AddNewMemberCommand(parent, p => p.AddDestructor()); command.Execute(); diagram.TrackCommand(command); ListViewItem item = AddOperationToList(command.Member as Destructor); item.Focused = true; item.Selected = true; OnContentsChanged(EventArgs.Empty); } }