Tuesday, April 12, 2011

For UML sequence diagram, is there any way to query the .sequencediagram and .seqencediagram.layout files through VMSDK?

Hello folks,

When extending UML functionality, I'm able to get the ISequenceDiagram object by querying DTE of VS 2010 SDK, now, I want to know the original .sequencediagram and .sequencediagram.layout files which describes the sequence diagram, is there any way to get it for VMSDK?

// Open all the project's diagrams.
                foreach (ProjectItem item in project.ProjectItems)
                {
                    IDiagramContext modelingItem = item as IDiagramContext;
                    if (modelingItem == null)
                        continue; // not a model diagram
                    IDiagram diagram = modelingItem.CurrentDiagram;
                    if (diagram == null)
                    {
                        // Diagram is closed. Open it.
                        item.Open().Activate();
                        diagram = modelingItem.CurrentDiagram;
                    }
                    ISequenceDiagram sd = diagram as ISequenceDiagram;
                    if (sd != null)
                    {
                        if (sd.Interaction != null && sd.Interaction.Name == diagramName)
                        {
                            resolvedSequenceDiagram.Add(sd);
                        }
                        else
                            continue;
                    }
                }

egyptian architecture architecture history business architecture church architecture architecture magazine

No comments:

Post a Comment