Ejemplo n.º 1
0
        /// <summary>
        ///     Retrieve tracked positions. Generally called from an AfterListShuffle event
        /// </summary>
        /// <param name="key">The key for the tracked positions. Usually the instance of the object tracking positions.</param>
        /// <param name="multiColumnPositions">Specify if the positions use multi or single column indices</param>
        /// <returns>An array of PositionTracker structures</returns>
        public PositionTracker[] RetrievePositions(object key, bool multiColumnPositions)
        {
            var positions = myTable[key] as PositionTracker[];

            if (!multiColumnPositions &&
                positions != null &&
                myMultiColumnTree != null)
            {
                var positionsCount = positions.Length;
                int endRow;
                for (var i = 0; i < positionsCount; ++i)
                {
                    endRow = positions[i].EndRow;
                    if (endRow != -1)
                    {
                        positions[i].EndRow = myMultiColumnTree.TranslateMultiColumnRow(endRow);
                        positions[i].Column = 0;
                    }
                }
            }
            return(positions);
        }