Пример #1
0
        public override ModelTreeNode AddItem()
        {
            var item = new IncludeModel();
            //should be typed to something more specific
            var node = new IncludeTreeNode <TModel, TNode>()
            {
                Model = item
            };

            node.AddDefaultChildNodesHack();
            Nodes.Add(node);

            return(node);
        }
Пример #2
0
        public override void AddChildModel(IModel model)
        {
            var incModel    = (IncludeModel)model;
            var childModels = incModel.Load <TModel>();

            var node = new IncludeTreeNode <TModel, TNode>()
            {
                Model = model
            };

            node.AddDefaultChildNodesHack();
            node.AddChildModels(childModels.Cast <IModel>().ToList());

            //add to tree
            Nodes.Add(node);
        }