当我尝试使用 Visual Studio 和 Enterprise Architect 编译我的程序时出现此错误。
我正在为 Enterprise Architect 编写一个工具,我必须制作一个图表,并且我继续收到此错误,我不知道该怎么办。
我有问题的代码是:
public Graph(EA.Repository repository)
{
EA.Diagram maindiagram;
this.modelRepository = repository;
maindiagram = repository.GetCurrentDiagram(); //recupero del diagramma
this.diagramId = maindiagram.DiagramID; //identificativo del diagramma
//inizializzazione nodi
Collection nodeCollection = maindiagram.DiagramObjects;
nodeList = new ArrayList();
foreach (DiagramObject diagram in maindiagram.DiagramObjects)
{
diagramList.Add(diagram);
foreach (Element element in diagramList)
{
if (element.Type == "Class"|| element.Type == "Component"||element.Type == "Package")
{ nodeList.Add(new Node(diagram, ref repository)); }
}
}
//inizializzazione archi
Collection linkCollection = maindiagram.DiagramLinks;
linkList = new ArrayList();
foreach (DiagramLink edge in maindiagram.DiagramLinks)
{
edgeList.Add(edge);
foreach(Connector connector in edgeList)
if (connector.Type == "Association" || connector.Type == "Aggregation" || connector.Type == "Compose" || connector.Type == "Dependency"
|| connector.Type == "Generalization" || connector.Type == "Realization")
{ linkList.Add(new Link (edge, ref repository));}
}
如果你知道怎么做,请帮忙。
十分感谢!