Example #1
0
        public void IncrementFragmentCount(string fragment, int count = 1)
        {
            if (!FragmentCounts.ContainsKey(fragment))
            {
                FragmentCounts.Add(fragment, 0);
            }

            FragmentCounts[fragment] += count;
        }
Example #2
0
        public int GetFragmentCount(string fragment)
        {
            if (!FragmentCounts.ContainsKey(fragment))
            {
                return(0);
            }

            return(FragmentCounts[fragment]);
        }
Example #3
0
        public void DecrementFragmentCount(string fragment, int count = 1)
        {
            if (!FragmentCounts.ContainsKey(fragment))
            {
                FragmentCounts.Add(fragment, 0);
            }

            FragmentCounts[fragment] -= count;

            if (FragmentCounts[fragment] < 0)
            {
                FragmentCounts[fragment] = 0;
            }
        }