コード例 #1
0
        }//end RemoveInterests(UserInterests)

        /// <summary>
        /// Removes a single interest from the list, works by deducting the amount of occurances, if that number becomes zero, remove the interest entirely
        /// </summary>
        /// <param name="InterestIn"> the interest to search for </param>
        public void RemoveInterest(UserInterest InterestIn)
        {
            if (Interests.ContainsKey(InterestIn))
            {
                Interests[InterestIn]--;
                if (Interests[InterestIn] == 0)
                {
                    Interests.Remove(InterestIn);
                }
            }
        }//end RemoveInterest(UserInterest)
コード例 #2
0
        }//end AddInterests(UserInterests)

        /// <summary>
        /// Adds a single interest to the dictionary, if the interest already exists inc the key, if not, add it to the dictionary
        /// </summary>
        /// <param name="InterestIn"> The interest to search for </param>
        public void AddInterest(UserInterest InterestIn)
        {
            if (Interests.ContainsKey(InterestIn))
            {
                Interests[InterestIn]++;
            }
            else
            {
                Interests.Add(InterestIn, 1);
            }
        }//end AddInterest(InterestIn)
コード例 #3
0
        }//end RemoveInterest(UserInterest)

        public int GetValue(UserInterest InterestIn)
        {
            return(Interests[InterestIn]);
        }//end GetKey(UserInterest)
コード例 #4
0
        }//end Process()

        #region List Methods
        /// <summary>
        /// Performs a binary search on the Interests list
        /// </summary>
        /// <param name="InterestsIn"> The Interest that we're searching for </param>
        /// <returns> The indexed position of the Interests or a negative number if nothing found </returns>
        public int SearchInterests(UserInterest InterestIn)
        {
            return(this.Interests.BinarySearch(InterestIn));
        }//end SearchInterests(Interests)
コード例 #5
0
        }//end Add(UserInterest)

        public void Remove(UserInterest InterestIn)
        {
            this.Interests.Remove(InterestIn);
        }//end Remove(UserInterest)
コード例 #6
0
        }//end SortInterests()

        public void Add(UserInterest InterestIn)
        {
            this.Interests.Add(InterestIn);
        }//end Add(UserInterest)