Example #1
0
            private int SumValue()
            {
                if (!SubNodes.Any())
                {
                    return(Metadata.Sum());
                }

                var output = 0;

                foreach (var item in Metadata)
                {
                    if (item < 1 || item > SubNodes.Count())
                    {
                        continue;
                    }

                    output += SubNodes[item - 1].SumValue();
                }

                return(output);
            }
Example #2
0
 public bool HasSubNode()
 {
     return(SubNodes != null && SubNodes.Any());
 }