示例#1
0
        private SimpleTreeNode <DS.TagNode> RetrieveNodeDataFromTag(string _tag)
        {
            TagAndNodeData _pair = _labelsIDPair.Where(x => x.tag == _tag).FirstOrDefault();
            SimpleTreeNode <DS.TagNode> _dnode;

            if (_pair != null)
            {
                _dnode = tagPan.treeDataStructure.GetEnumerable(TreeTraversalType.BreadthFirst, TreeTraversalDirection.TopDown).Where(x => x.Value.ID == _pair.ID).FirstOrDefault();
            }
            else
            {
                _dnode = null;
            }

            return(_dnode);
        }
        private SimpleTreeNode <TagNode> RetrieveNodeDataFromTag(string _tag)
        {
            TagAndNodeData _pair = (
                from x in this._labelsIDPair
                where x.tag == _tag
                select x).FirstOrDefault <TagAndNodeData>();
            SimpleTreeNode <TagNode> result;

            if (_pair != null)
            {
                result = (
                    from x in this.tagPan.treeDataStructure.GetEnumerable(TreeTraversalType.BreadthFirst, TreeTraversalDirection.TopDown)
                    where x.Value.ID == _pair.ID
                    select x).FirstOrDefault <SimpleTreeNode <TagNode> >();
            }
            else
            {
                result = null;
            }
            return(result);
        }