Dev2.Models.ExplorerItemModel.GetChildrenCount C# (CSharp) Method

GetChildrenCount() private method

private GetChildrenCount ( ) : int
return int
        private int GetChildrenCount()
        {
            int total = 0;
            foreach(var explorerItemModel in Children)
            {
                if(explorerItemModel.ResourceType != ResourceType.Version &&
                   explorerItemModel.ResourceType != ResourceType.Message)
                {
                    if(explorerItemModel.ResourceType == ResourceType.Folder)
                    {
                        total += explorerItemModel.ChildrenCount;
                    }
                    else
                    {
                        total++;
                    }
                }
            }
            return total;
        }