public SrmDocument SetDocNodeAnnotations(SrmDocument document, NodeRef nodeRef, Annotations annotations) { var identityPath = ToIdentityPath(nodeRef); var docNode = document.FindNode(identityPath); docNode = docNode.ChangeAnnotations(annotations); document = (SrmDocument)document.ReplaceChild(identityPath.Parent, docNode); return(document); }
private IdentityPath ToIdentityPath(NodeRef nodeRef) { IdentityPath identityPath; if (_identityPaths.TryGetValue(nodeRef, out identityPath)) { return(identityPath); } identityPath = nodeRef.ToIdentityPath(Document); if (identityPath == null) { throw ElementNotFoundException(nodeRef); } _identityPaths.Add(nodeRef, identityPath); return(identityPath); }
protected NodeRef(NodeRef parent) : base(parent) { }
// Resharper restore NonLocalizedString protected ResultRef(NodeRef parent) : base(parent) { }