private static void Assign(Level result, StatisticsFact fact, string[] dimensions, int depth)
        {
            if (depth == dimensions.Length)
            {
                return;
            }

            if (depth == dimensions.Length - 1)
            {
                int current = result.Next[fact.Dimensions[dimensions[depth]]].Amount;

                result.Next[fact.Dimensions[dimensions[depth]]].Amount = current + fact.Amount;
            }
            else
            {
                Assign(result.Next[fact.Dimensions[dimensions[depth]]], fact, dimensions, depth + 1);
            }
        }
        private static void Expand(Level result, StatisticsFact fact, string[] dimensions, int depth)
        {
            if (depth == dimensions.Length)
            {
                return;
            }

            if (!result.Next.ContainsKey(fact.Dimensions[dimensions[depth]]))
            {
                if (depth == dimensions.Length - 1)
                {
                    result.Next[fact.Dimensions[dimensions[depth]]] = new Level(0);
                    return;
                }
                else
                {
                    result.Next[fact.Dimensions[dimensions[depth]]] = new Level(new Dictionary <string, Level>());
                }
            }

            Expand(result.Next[fact.Dimensions[dimensions[depth]]], fact, dimensions, depth + 1);
        }
Esempio n. 3
0
        private static void Expand(Level result, StatisticsFact fact, string[] dimensions, int depth)
        {
            if (depth == dimensions.Length)
            {
                return;
            }

            if (!result.Next.ContainsKey(fact.Dimensions[dimensions[depth]]))
            {
                if (depth == dimensions.Length - 1)
                {
                    result.Next[fact.Dimensions[dimensions[depth]]] = new Level(0);
                    return;
                }
                else
                {
                    result.Next[fact.Dimensions[dimensions[depth]]] = new Level(new Dictionary<string, Level>());
                }
            }

            Expand(result.Next[fact.Dimensions[dimensions[depth]]], fact, dimensions, depth + 1);
        }
Esempio n. 4
0
 private bool HasVersion(StatisticsFact fact, string version)
 {
     return(fact != null &&
            fact.Dimensions.TryGetValue("Version", out string actualVersion) &&
            StringComparer.OrdinalIgnoreCase.Equals(version, actualVersion));
 }
Esempio n. 5
0
        private static void Assign(Level result, StatisticsFact fact, string[] dimensions, int depth)
        {
            if (depth == dimensions.Length)
            {
                return;
            }

            if (depth == dimensions.Length - 1)
            {
                int current = result.Next[fact.Dimensions[dimensions[depth]]].Amount;

                result.Next[fact.Dimensions[dimensions[depth]]].Amount = current + fact.Amount;
            }
            else
            {
                Assign(result.Next[fact.Dimensions[dimensions[depth]]], fact, dimensions, depth + 1);
            }
        }