public void Remove()
        {
            if (_previousSibling != null)
            {
                if (_nextSibling != null)
                {
                    // Middle node
                    _previousSibling._nextSibling = _nextSibling;
                    _nextSibling._previousSibling = _previousSibling;
                }
                else
                {
                    // Last node
                    _previousSibling._nextSibling = null;
                }
            }
            else
            {
                if (_parent != null)
                {
                    _parent._firstChild = _nextSibling;
                }

                if (_nextSibling != null)
                {
                    // First node
                    _nextSibling._previousSibling = null;
                    _nextSibling._parent          = _parent;
                }
            }

            _nextSibling     = null;
            _previousSibling = null;
            _parent          = null;
        }
Example #2
0
        private void BeginScope(BamlBlock block, RecordType endRecord)
        {
            var scope = new Scope()
            {
                Block     = block,
                EndRecord = endRecord,
                DefKeys   = _currentScope.DefKeys,
            };

            _scopeStack.Push(_currentScope);

            _currentScope = scope;

            _scopes.Add(scope);
        }