// re-set a certain link-view data by a link-model public void setDataByLinkModel(LinkModel linkModel, bool isOutgoing) { LinkView linkView = null; if (isOutgoing) { linkView = mExistedOutgoingLinks.Find(it => it.Model.Equals(linkModel)); } else { linkView = mExistedIngoingLinks.Find(it => it.Model.Equals(linkModel)); } if (linkView is null) { return; } linkView.setSrcAndDstPorts(linkModel.SrcPortType, linkModel.DstPortType, makeHistory: false); linkView.generateLinesAndAddToSectionList(); Invalidate(); }
// add a new link-view public void AddLinkView(LinkView newLinkView) { mExistedOutgoingLinks.Add(newLinkView); mExistedIngoingLinks.Add(newLinkView); Invalidate(); }