XAF_Bootstrap.Controls.XafBootstrapStructureView.BuildData C# (CSharp) Метод

BuildData() публичный Метод

public BuildData ( ) : void
Результат void
        public void BuildData()
        {
            Root.Controls.Clear();

            var collection = Collection.List.OfType<ITreeNode>().ToList();
            if (collection != null)
            {
                var form = Helpers.RequestManager.Request.Form;

                var builder = new StringBuilder();

                var structuresList = (currentStart != null ? (new ITreeNode[] { currentStart }).ToList() : collection.Where(f => f.Parent == null || collection.IndexOf(f.Parent) == -1).ToList());

                var structures = new StringBuilder();

                foreach (var structure in structuresList)
                {
                    var nested = structure.Children.OfType<ITreeNode>();

                    structures.AppendFormat(@"<br>{0}<hr/>", GetPathStructure(structure));
                    structures.AppendFormat(@"<ul class=""list-inline row nomargins"">");

                    var liStyle = @"<li style='vertical-align: top;' class='col-sm-4'>";

                    if (nested.Count() > 0)
                    {
                        foreach (var sub1 in nested)
                        {
                            structures.AppendFormat(liStyle);
                            var subNested = sub1.Children.OfType<ITreeNode>().ToList();
                            if (subNested.Count > 0)
                            {
                                structures.AppendFormat(@"<h6><b>{0}</b></h6><hr class='nopaddings nomargins'/>", GetFormattedStructure(sub1));
                                if (currentStart != null)
                                    foreach (var sub2 in subNested)
                                        structures.AppendFormat(@"<h6>{0}</h6>", GetFormattedStructure(sub2));
                            }
                            else
                            {
                                structures.AppendFormat(@"<h6>{0}</h6>", GetFormattedStructure(sub1));
                            }

                            structures.AppendFormat(@"</li>");
                        }
                    };

                    structures.AppendFormat(@"</ul>");
                }

                builder.AppendFormat(@"{0}", structures.ToString());

                Root.Controls.Add(new HTMLText() { Text = builder.ToString() });

            }
        }