我正在使用特定的關聯連接器C連接到源element A
和target element B
的Enterprise Architect
。如何通過c#插件刪除企業架構圖中的連接器
如果用戶使用不同的源和目的地元件欲顯示警告消息並使用c#
附加代碼刪除連接器之間的該連接器:
以下是我使用的代碼。我無法刪除連接器。
public void ToDeleteConnectorByID(int connectorID)
{
try
{
EA.Connector addedConnector = Session.Repository.GetConnectorByID(Convert.ToInt32(connectorID));
EA.Element cuurentobjectconnectorele = Session.Repository.GetElementByID(addedConnector.ClientID);
for (short m = 0; m < cuurentobjectconnectorele.Connectors.Count - 1; m++)
{
cuurentobjectconnectorele.Connectors.Delete(m);
cuurentobjectconnectorele.Update();
}
}
catch (Exception ex)
{
MessageBox.Show("no connector deleted-exception");
}
}
謝謝。 。它工作正常... – rashmi
@rashmi如果解決了,請接受它作爲答案 – Arshad