/// <summary>
        /// Builds the tree.
        /// </summary>
        private void BuildTree()
        {
            AppendTaskDescriptionsToNode(this._nodeMfu, MostRecentlyUsedService.FindTopMostFrequentlyUsed(MaximumItemCount));
            AppendTaskDescriptionsToNode(this._nodeMru, MostRecentlyUsedService.FindTopMostRecentlyUsed(MaximumItemCount));
            AppendTaskDescriptionsToNode(this._nodePinned, this._data.PinnedTaskDescriptions);

            Sort(this._nodePinned);
        }
        /// <summary>
        /// Finds the top most frequently used.
        /// </summary>
        /// <param name="maximum">The maximum.</param>
        /// <returns></returns>
        public static TaskDescription[] FindTopMostFrequentlyUsed(int maximum)
        {
            MostRecentlyUsedService service = MostRecentlyUsedService._current;

            if (service == null)
            {
                return new TaskDescription[] { }
            }
            ;

            return(service.InternalFindTopMostFrequentlyUsed(maximum));
        }
 /// <summary>
 /// Initializes a new instance of the <see cref="MostRecentlyUsedService"/> class.
 /// </summary>
 public MostRecentlyUsedService()
 {
     MostRecentlyUsedService._current = this;
     this._items = new List <MostRecentlyUsedItem>();
 }