internal SuspendToken(SuspendableDocumentLeafNode parent) { var suspendLevel = System.Threading.Interlocked.Increment(ref parent._suspendLevel); _parent = parent; if (1 == suspendLevel) { try { _parent.OnSuspended(); } catch (Exception) { System.Threading.Interlocked.Decrement(ref parent._suspendLevel); _parent = null; throw; } } }
internal TemporaryResumeToken(SuspendableDocumentLeafNode parent) { _parent = parent; }
protected override IEnumerable<DocumentNodeAndName> GetDocumentNodeChildrenWithName() { if (null != _child) yield return new DocumentNodeAndName(_child, () => _child = null, "Child"); }
public TestNodeWithoutChild_SuspendableDocumentNode(SuspendableDocumentLeafNode child) { _child = child; }