SubGraph Child Enumeration

Probably a very simple question, but I am looking for a method to enumerate all GoObjects which are “children” of a subgraph. Something like:
foreach ( GoObject o in Subgraph.Children)
{
DoSomething (o);
}

The long version of the question is that I am interested in “ungrouping” a subgraph and placing all of the contained GoObjects onto a view or higher-level subgraph. Thanks for any help.

GoSubGraph inherits from GoNode which inherits from GoGroup, so you can do:
foreach ( GoObject o in aSubgraph)
{
DoSomething (o);
}
But note that this will include all GoObjects that are immediate children of the subgraph. That includes things such as the Handle and Label and maybe other special or decorative objects.
Both Demo1 and SubGraphApp have implementations of commands to “group” selected objects and “ungroup” groups.
Demo1 works with both general GoGroups as well as GoSubGraphs; SubGraphApp works with different kinds of specialized GoSubGraph classes.
Be sure to do things in the right order so that undo/redo will work. The issue is that no changes can be recorded unless the object has a GoUndoManager, and it can’t have an undo manager unless it’s part of a GoDocument that has an undo manager. So you don’t want to make undoable changes, say when building a subgraph, unless that subgraph is already part of the document.

Walter, thanks for the quick response. I keep forgetting how rich the sample applications are. I took a look at the SuGraphApp and it is almost exactly what I was after. If it is useful to others, I’ll be glad to post any code once I get it working?