Exemplo n.º 1
0
        public void Dispose()
        {
            _xmlDocument = null;
            _xmlParse    = null;

            if (_childToParentNodeStack != null)
            {
                _childToParentNodeStack.Clear();
                _childToParentNodeStack.TrimExcess();
                _childToParentNodeStack = null;
            }

            GC.SuppressFinalize(this);
        }
Exemplo n.º 2
0
        /// <param name="isSort">节点排序</param>
        /// <param name="parseNode">自定义节点解析,可为null</param>
        /// <returns>XmlParse</returns>
        public XmlParse TryParse(Action <XmlDocument> loadXml, bool isSort, Action <XmlParseNode> parseNode)
        {
            if (loadXml == null)
            {
                return(null);
            }

            _xmlParse = ParseXml(loadXml, isSort, parseNode, ref _xmlDocument);

            if (_xmlParse != null)
            {
                _childToParentNodeStack.Clear();
                _childToParentNodeStack.TrimExcess();

                ConstructC2PStack(_xmlParse.NodeCollection, new List <XmlParseNode>());
                UpdateXmlParseNodeVisible();
            }

            return(_xmlParse);
        }