element A
とtarget element B
のEnterprise Architect
に特定の関連付けコネクタCを使用して接続しています。c#addinを通じてエンタープライズアーキテクト図のコネクタを削除する方法
ユーザーが別の送信元と宛先の要素の間、このコネクタを使用している場合、私は警告メッセージを表示し、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");
}
}
ありがとうございます。 .itは正常に動作しています... – rashmi
@rashmi解決したら回答として受け入れてください – Arshad