public bool DeleteNode(
ServerSystemContext context,
NodeId nodeId)
{
ServerSystemContext contextToUse = m_systemContext.Copy(context);
bool found = false;
List<LocalReference> referencesToRemove = new List<LocalReference>();
lock (Lock)
{
if (m_predefinedNodes == null)
{
return false;
}
NodeState node = null;
if (PredefinedNodes.TryGetValue(nodeId, out node))
{
RemovePredefinedNode(contextToUse, node, referencesToRemove);
found = true;
}
RemoveRootNotifier(node);
}
// must release the lock before removing cross references to other node managers.
if (referencesToRemove.Count > 0)
{
Server.NodeManager.RemoveReferences(referencesToRemove);
}
return found;
}
#endregion