System.Xml.Xsl.Runtime.XmlSortKey.AddSortKey C# (CSharp) Method

AddSortKey() public method

Sometimes a key is composed of multiple parts. For example: (LastName, FirstName). Multi-part keys are linked together in a list. This method recursively adds a new key part to the end of the list. Returns the first (primary) key in the list.
public AddSortKey ( XmlSortKey sortKey ) : XmlSortKey
sortKey XmlSortKey
return XmlSortKey
        public XmlSortKey AddSortKey(XmlSortKey sortKey)
        {
            if (_nextKey != null)
            {
                // Add to end of list--this is not it
                _nextKey.AddSortKey(sortKey);
            }
            else
            {
                // This is the end of the list
                _nextKey = sortKey;
            }

            return this;
        }

Usage Example

Exemplo n.º 1
0
        public XmlSortKey AddSortKey(XmlSortKey sortKey)
        {
            if (_nextKey != null)
            {
                // Add to end of list--this is not it
                _nextKey.AddSortKey(sortKey);
            }
            else
            {
                // This is the end of the list
                _nextKey = sortKey;
            }

            return(this);
        }