Example #1
0
        public List <FeatureNode> Build()
        {
            var result = new List <FeatureNode>();

            var parentFeatures = FeatureHelper.GetFeaturesWithType(FeatureType.Parent);

            foreach (var parentFeature in parentFeatures)
            {
                var parentInfo = FeatureInfo.Builder.Build(parentFeature, FeatureType.Parent);
                var parentNode = new FeatureNode(parentInfo);

                foreach (var childFeature in FeatureHelper.GetChildFeatures(parentFeature))
                {
                    var childInfo = FeatureInfo.Builder.Build(childFeature, FeatureType.Child);
                    var childNode = new FeatureNode(childInfo, parentNode);

                    parentNode.Nodes.Add(childNode);
                }

                result.Add(parentNode);
            }

            return(result);
        }