public ThemeDictionariesTreeItemViewModel(ITreeViewModel treeViewModel, TreeItemViewModel parent, IDictionary<object, object> themeDictionaries) : base(treeViewModel, parent)
 {
     foreach (var themeDictionary in themeDictionaries)
     {
         this.Children.Add(new ResourceDictionaryTreeItemViewModel(treeViewModel, this, (ResourceDictionary)themeDictionary.Value, themeDictionary.Key));
     }
 }
 public MergedDictionariesTreeItemViewModel(ITreeViewModel treeViewModel, TreeItemViewModel parent, IList<ResourceDictionary> mergedDictionaries)
     : base(treeViewModel, parent)
 {
     foreach (var mergedDictionary in mergedDictionaries)
     {
         this.Children.Add(new ResourceDictionaryTreeItemViewModel(treeViewModel, this, mergedDictionary));
     }
 }
 public StubTreeItemViewModel(
     VisualTreeViewModel treeModel,
     TreeItemViewModel parent,
     string displayName = "Loading...",
     string description = "Please wait while more content is loaded...")
     : base(treeModel, parent)
 {
     _displayName = displayName;
     _description = description;
 }
 protected void RaiseDescendantSelected(TreeItemViewModel newItem)
 {
     if (Parent != null) {
         ((TreeItemViewModel)Parent).RaiseDescendantSelected(newItem);
     } else {
         var handler = DescendantSelected;
         if (handler != null) {
             handler.Invoke(newItem, EventArgs.Empty);
         }
     }
 }
        //public void TreeViewItem_MouseRightButtonDown(object sender, MouseButtonEventArgs e)
        //{
        //    // 那么在这里面的代码发生在PreviewMouseRightButtonDown中的代码之后,逻辑正确
        //    Model.TreeView_MouseRightButtonDown(sender, e);
        //}


        //private void TreeViewItem_PreviewMouseRightButtonDown(object sender, MouseButtonEventArgs e)
        //{
        //    Model.TreeView_PreviewMouseRightButtonDown(sender, e);
        //}

        private void TextBox_LostFocus(object sender, RoutedEventArgs e)
        {
            Type itemType = typeof(RadTreeViewItem);

            UIElement child  = sender as UIElement;
            UIElement father = null;

            if (itemType != null)
            {
                father = (UIElement)child.GetVisualAncestor(itemType);
            }

            if (father != null)
            {
                TreeItemViewModel item = ((RadTreeViewItem)father).DataContext as TreeItemViewModel;
                if (item.TxbNameVisi == Visibility.Visible)
                {
                    item.StopEditName();
                }
            }
        }
        /// <summary>
        /// Remove a session from tree but still alive.
        /// </summary>
        public void Remove(Session session)
        {
            if (session == null)
            {
                throw new ArgumentNullException("session");
            }

            TreeItemViewModel node = FindNode(NodesTV.TreeItems, session);

            if (node != null)
            {
                node.Children.Clear();
            }

            // close any dialogs.
            foreach (SubscriptionDlg dialog in new List <SubscriptionDlg>(m_dialogs.Values))
            {
                //dialog.Close();
            }
            NodesTV.TreeItems.Remove(node);
        }
        /// <see cref="BaseTreeCtrl.SelectNode" />
        protected override void SelectNode()
        {
            base.SelectNode();

            TreeItemViewModel selectedNode = NodesTV.SelectedItem;

            Session      session      = Get <Session>(selectedNode);
            Subscription subscription = Get <Subscription>(selectedNode);

            // update address space control.
            if (m_AddressSpaceCtrl != null)
            {
                m_AddressSpaceCtrl.SetView(session, BrowseViewType.Objects, null);
            }

            // update notification messages control.
            if (m_NotificationMessagesCtrl != null)
            {
                m_NotificationMessagesCtrl.Initialize(session, subscription);
            }
        }
        private static TreeItemViewModel BuildTree(FileEntry parent)
        {
            var treeItem = new TreeItemViewModel
            {
                Name        = parent.Name,
                Children    = new ObservableCollection <TreeItemViewModel>(),
                IsDirectory = parent.IsDirectory
            };

            foreach (var folder in parent.Folders)
            {
                treeItem.Children.Add(BuildTree(folder));
            }
            foreach (var file in parent.Files)
            {
                treeItem.Children.Add(new TreeItemViewModel {
                    Name = file.Name
                });
            }
            return(treeItem);
        }
Esempio n. 9
0
        /// <see cref="BaseTreeCtrl.BeforeExpand" />
        protected override async Task BeforeExpand(TreeItemViewModel clickedNode)
        {
            // check if a placeholder child is present.
            if (clickedNode.Children.Count == 1 && String.IsNullOrEmpty(((TreeItemViewModel)clickedNode.Children[0]).Text))
            {
                // do nothing if an error is detected.
                if (!m_browser.Session.KeepAliveStopped)
                {
                    await Dispatcher.RunAsync(
                        CoreDispatcherPriority.Low,
                        () =>
                    {
                        // clear dummy children.
                        clickedNode.Children.Clear();

                        // browse.
                        Browse(clickedNode);
                    });
                }
            }
        }
Esempio n. 10
0
        private void BrowseServerViewsMI_DropDownOpening(object sender, EventArgs e)
        {
            try
            {
                TreeItemViewModel selectedNode = NodesTV.SelectedItem;

                // change nothing if nothing selected.
                if (selectedNode == null)
                {
                    return;
                }

                // get selected session.
                Session session = selectedNode.Item as Session;

                if (session != null)
                {
                    Browser browser = new Browser(session);

                    browser.BrowseDirection   = BrowseDirection.Forward;
                    browser.IncludeSubtypes   = true;
                    browser.ReferenceTypeId   = null;
                    browser.NodeClassMask     = (int)NodeClass.View;
                    browser.ContinueUntilDone = true;

                    ReferenceDescriptionCollection references = browser.Browse(Objects.ViewsFolder);

                    foreach (ReferenceDescription reference in references)
                    {
                        //ToolStripItem item = BrowseServerViewsMI.DropDown.Items.Add(reference.ToString());
                        //item.Click += new EventHandler(BrowseServerViewsMI_Click);
                        //item.Tag = reference;
                    }
                }
            }
            catch (Exception exception)
            {
                GuiUtils.HandleException(String.Empty, GuiUtils.CallerName(), exception);
            }
        }
Esempio n. 11
0
        private void TheTreeView_Drop(object sender, DragEventArgs e)
        {
            e.Effects = DragDropEffects.None;
            e.Handled = true;


            // Verify that this is a valid drop and then store the drop target
            TreeViewItem container = GetNearestContainer(e.OriginalSource as UIElement);

            if (container != null)
            {
                TreeItemViewModel sourceNode = (TreeItemViewModel)e.Data.GetData(typeof(TreeItemViewModel));
                TreeItemViewModel targetNode = (TreeItemViewModel)container.Header;
                if ((sourceNode != null) && (targetNode != null))
                {
                    //if (!targetNode.MoreStuff.Contains(sourceNode))
                    {
                        _targetNode = targetNode;
                        e.Effects   = DragDropEffects.Move;
                    }
                }
            }
        }
Esempio n. 12
0
        private TreeViewItem GetContainerFromStuff(TreeItemViewModel stuff)
        {
            Stack <TreeItemViewModel> _stack = new Stack <TreeItemViewModel>();

            _stack.Push(stuff);
            TreeItemViewModel parent = stuff.Parent;

            while (parent != null)
            {
                _stack.Push(parent);
                parent = parent.Parent;
            }

            ItemsControl container = treeview;

            while ((_stack.Count > 0) && (container != null))
            {
                TreeItemViewModel top = _stack.Pop();
                container = (ItemsControl)container.ItemContainerGenerator.ContainerFromItem(top);
            }

            return(container as TreeViewItem);
        }
        public ResourceDictionaryTreeItemViewModel(
            ITreeViewModel treeViewModel,
            TreeItemViewModel parent,
            ResourceDictionary resourceDictionary,
            object key = null)
            : base(treeViewModel, parent)
        {
            this.QualifierString = String.Empty;

            if (key != null)
            {
                this.QualifierString += $" [{key}]";
            }

            if (resourceDictionary.Source != null)
            {
                this.QualifierString += $" Source: {resourceDictionary.Source}";
            }

            if (resourceDictionary.MergedDictionaries != null &&
                resourceDictionary.MergedDictionaries.Count > 0)
            {
                this.Children.Add(new MergedDictionariesTreeItemViewModel(treeViewModel, this, resourceDictionary.MergedDictionaries));
            }

            if (resourceDictionary.ThemeDictionaries != null &&
                resourceDictionary.ThemeDictionaries.Count > 0)
            {
                this.Children.Add(new ThemeDictionariesTreeItemViewModel(treeViewModel, null, resourceDictionary.ThemeDictionaries));
            }

            foreach (var kvp in resourceDictionary.ToList())
            {
                this.Properties.Add(new ResourceViewModel(kvp.Key, kvp.Value, resourceDictionary));
            }
        }
        public ResourceDictionaryTreeItemViewModel(
            ITreeViewModel treeViewModel,
            TreeItemViewModel parent,
            ResourceDictionary resourceDictionary,
            object key = null)
            : base(treeViewModel, parent)
        {
            this.QualifierString = String.Empty;

            if (key != null)
            {
                this.QualifierString += $" [{key}]";
            }

            if (resourceDictionary.Source != null)
            {
                this.QualifierString += $" Source: {resourceDictionary.Source}";
            }

            if (resourceDictionary.MergedDictionaries != null &&
                resourceDictionary.MergedDictionaries.Count > 0)
            {
                this.Children.Add(new MergedDictionariesTreeItemViewModel(treeViewModel, this, resourceDictionary.MergedDictionaries));
            }

            if (resourceDictionary.ThemeDictionaries != null &&
                resourceDictionary.ThemeDictionaries.Count > 0)
            {
                this.Children.Add(new ThemeDictionariesTreeItemViewModel(treeViewModel, null, resourceDictionary.ThemeDictionaries));
            }

            foreach (var kvp in resourceDictionary.ToList())
            {
                this.Properties.Add(new ResourceViewModel(kvp.Key, kvp.Value, resourceDictionary));
            }
        }
Esempio n. 15
0
        private void TreeView_MouseMove(object sender, MouseEventArgs e)
        {
            if (e.LeftButton == MouseButtonState.Pressed)
            {
                if (mousedown == false)//只有左键按下才能拖拽
                {
                    return;
                }
                Point currentPosition = e.GetPosition(treeview);

                // Note: This should be based on some accessibility number and not just 2 pixels
                if ((Math.Abs(currentPosition.X - _lastMouseDown.X) > 4.0) ||
                    (Math.Abs(currentPosition.Y - _lastMouseDown.Y) > 4.0))
                {
                    TreeItemViewModel selectedItem = (TreeItemViewModel)treeview.SelectedItem;
                    if ((selectedItem != null) && (selectedItem.Parent != null))
                    {
                        TreeViewItem container = GetContainerFromStuff(selectedItem);
                        if (container != null)
                        {
                            DragDropEffects finalDropEffect = DragDrop.DoDragDrop(container, selectedItem, DragDropEffects.Move);
                            if ((finalDropEffect == DragDropEffects.Move) && (_targetNode != null))
                            {
                                // A Move drop was accepted
                                if (_targetNode != selectedItem)//避免删除自己
                                {
                                    selectedItem.Parent.Children.Remove(selectedItem);
                                    _targetNode.Children.Add(selectedItem);
                                }
                                _targetNode = null;
                            }
                        }
                    }
                }
            }
        }
Esempio n. 16
0
        /// <summary>
        /// Recursively finds the node with the specified tag.
        /// </summary>
        private TreeItemViewModel FindNode(TreeItemViewModel vm, object item)
        {
            if (Object.ReferenceEquals(vm.Item, item))
            {
                return(vm);
            }

            foreach (TreeItemViewModel node in vm.Children)
            {
                if (Object.ReferenceEquals(node.Item, item))
                {
                    return(node);
                }

                TreeItemViewModel child = FindNode(node, item);

                if (child != null)
                {
                    return(child);
                }
            }

            return(null);
        }
Esempio n. 17
0
 public void DoInvoke(TreeItemViewModel item)
 {
     InvokeItem?.Invoke(this, new InvokeEventArgs(item));
 }
Esempio n. 18
0
 public InvokeEventArgs(TreeItemViewModel item)
 {
     Item = item;
 }
Esempio n. 19
0
 /// <see cref="BaseTreeCtrl.EnableMenuItems" />
 protected override void EnableMenuItems(TreeItemViewModel clickedNode)
 {
     // Context menu is currently not implemented
 }
Esempio n. 20
0
        /// <summary>
        /// Gets all both category and non-category item decendents for the provided categoryItem.
        /// This method updates the provided categoryItem.
        /// </summary>
        /// <param name="categoryItem">The category item.</param>
        /// <param name="currentPerson">The current person.</param>
        /// <param name="categoryService">The category service.</param>
        /// <param name="serviceInstance">The service instance.</param>
        /// <param name="cachedEntityType">The cached entity type of the items.</param>
        /// <param name="options">The options that describe the current operation.</param>
        /// <returns></returns>
        private TreeItemViewModel GetAllDescendants(TreeItemViewModel categoryItem, Person currentPerson, CategoryService categoryService, IService serviceInstance, EntityTypeCache cachedEntityType, CategoryItemTreeOptions options)
        {
            if (categoryItem.IsFolder)
            {
                var parentGuid      = categoryItem.Value.AsGuidOrNull();
                var childCategories = categoryService.Queryable()
                                      .AsNoTracking()
                                      .Where(c => c.ParentCategory.Guid == parentGuid)
                                      .OrderBy(c => c.Order)
                                      .ThenBy(c => c.Name);

                foreach (var childCategory in childCategories)
                {
                    if (childCategory.IsAuthorized(Authorization.VIEW, currentPerson))
                    {
                        // This category has child categories that the person can view so add them to categoryItemList
                        categoryItem.HasChildren = true;
                        var childCategoryItem = new TreeItemViewModel
                        {
                            Value        = childCategory.Guid.ToString(),
                            Text         = childCategory.Name,
                            IsFolder     = true,
                            IconCssClass = childCategory.GetPropertyValue("IconCssClass") as string ?? options.DefaultIconCssClass
                        };

                        if (childCategory is IHasActiveFlag activatedItem)
                        {
                            childCategoryItem.IsActive = activatedItem.IsActive;
                        }

                        var childCategorizedItemBranch = GetAllDescendants(childCategoryItem, currentPerson, categoryService, serviceInstance, cachedEntityType, options);
                        if (categoryItem.Children == null)
                        {
                            categoryItem.Children = new List <TreeItemViewModel>();
                        }

                        categoryItem.Children.Add(childCategorizedItemBranch);
                    }
                }

                // now that we have taken care of the child categories get the items for this category.
                if (options.GetCategorizedItems)
                {
                    var itemOptions = new CategorizedItemQueryOptions
                    {
                        CategoryGuid              = parentGuid,
                        IncludeInactiveItems      = options.IncludeInactiveItems,
                        IncludeUnnamedEntityItems = options.IncludeUnnamedEntityItems,
                        ItemFilterPropertyName    = options.ItemFilterPropertyName,
                        ItemFilterPropertyValue   = options.ItemFilterPropertyValue
                    };

                    var childQry = categoryService.GetCategorizedItemQuery(serviceInstance, itemOptions);

                    if (childQry != null)
                    {
                        var childItems = GetChildrenItems(options, cachedEntityType, childQry);

                        categoryItem.Children = new List <TreeItemViewModel>();
                        categoryItem.Children.AddRange(childItems);
                        categoryItem.HasChildren = childItems.Any();
                    }
                }
            }

            return(categoryItem);
        }
Esempio n. 21
0
        public ProjectTreeView()
        {
            InitializeComponent();
            ShowSecondCheck_Checked(null, null);

            // Create some example nodes to play with
            var rootNode = new TreeItemViewModel(null, false)
            {
                DisplayName = "rootNode"
            };
            var node1 = new TreeItemViewModel(rootNode, false)
            {
                DisplayName = "Graphical Elements", IsEditable = false
            };
            var node2 = new TreeItemViewModel(rootNode, false)
            {
                DisplayName = "Geological Data", IsEditable = false
            };
            var node3 = new TreeItemViewModel(rootNode, false)
            {
                DisplayName = "Geological Models", IsEditable = false
            };
            var node4 = new TreeItemViewModel(rootNode, false)
            {
                DisplayName = "Block Models", IsEditable = false
            };
            var node5 = new TreeItemViewModel(rootNode, false)
            {
                DisplayName = "Underground Plans", IsEditable = false
            };
            var node6 = new TreeItemViewModel(rootNode, false)
            {
                DisplayName = "Open Pit Plans", IsEditable = false
            };
            var node7 = new TreeItemViewModel(rootNode, false)
            {
                DisplayName = "Economic Assessments", IsEditable = false
            };
            var node132 = new TreeItemViewModel(node1, false)
            {
                DisplayName = "element132"
            };
            var node14 = new TreeItemViewModel(node1, false)
            {
                DisplayName = "element14 with colours"
            };
            var colorNode1 = new ColorItemViewModel(node14, false)
            {
                Color = Colors.Aqua, IsEditable = true
            };
            var colorNode2 = new ColorItemViewModel(node14, false)
            {
                Color = Colors.ForestGreen
            };
            var colorNode3 = new ColorItemViewModel(node14, false)
            {
                Color = Colors.LightSalmon
            };
            var node15 = new TreeItemViewModel(node1, true)
            {
                DisplayName = "element15 (lazy loading)"
            };

            // Add them all to each other
            rootNode.Children.Add(node1);
            rootNode.Children.Add(node2);
            rootNode.Children.Add(node3);
            rootNode.Children.Add(node4);
            rootNode.Children.Add(node5);
            rootNode.Children.Add(node6);
            rootNode.Children.Add(node7);
            node1.Children.Add(node14);
            node1.Children.Add(node132);
            node1.Children.Add(node15);
            node14.Children.Add(colorNode1);
            node14.Children.Add(colorNode2);
            node14.Children.Add(colorNode3);

            // Use the root node as the window's DataContext to allow data binding. The TreeView
            // will use the Children property of the DataContext as list of root tree items. This
            // property happens to be the same as each item DataTemplate uses to find its subitems.
            DataContext = rootNode;

            // Preset some node states
            node1.IsSelected  = true;
            node14.IsExpanded = true;
        }
Esempio n. 22
0
 public ExecutionTreeViewItem(TreeItemViewModel parent, bool lazyLoadChildren)
     : base(parent, lazyLoadChildren)
 {
 }
        public MainWindow()
        {
            InitializeComponent();
            ShowSecondCheck_Checked(null, null);

            // Create some example nodes to play with
            var rootNode = new TreeItemViewModel(null, false)
            {
                DisplayName = "rootNode"
            };
            var node1 = new TreeItemViewModel(rootNode, false)
            {
                DisplayName = "element1 (editable)", IsEditable = true
            };
            var node2 = new TreeItemViewModel(rootNode, false)
            {
                DisplayName = "element2"
            };
            var node11 = new TreeItemViewModel(node1, false)
            {
                DisplayName = "element11", Remarks = "Look at me!"
            };
            var node12 = new TreeItemViewModel(node1, false)
            {
                DisplayName = "element12 (disabled)", IsEnabled = false
            };
            var node13 = new TreeItemViewModel(node1, false)
            {
                DisplayName = "element13"
            };
            var node131 = new TreeItemViewModel(node13, false)
            {
                DisplayName = "element131"
            };
            var node132 = new TreeItemViewModel(node13, false)
            {
                DisplayName = "element132"
            };
            var node14 = new TreeItemViewModel(node1, false)
            {
                DisplayName = "element14 with colours"
            };
            var colorNode1 = new ColorItemViewModel(node14, false)
            {
                Color = Colors.Aqua, IsEditable = true
            };
            var colorNode2 = new ColorItemViewModel(node14, false)
            {
                Color = Colors.ForestGreen
            };
            var colorNode3 = new ColorItemViewModel(node14, false)
            {
                Color = Colors.LightSalmon
            };
            var node15 = new TreeItemViewModel(node1, true)
            {
                DisplayName = "element15 (lazy loading)"
            };

            // Add them all to each other
            rootNode.Children.Add(node1);
            rootNode.Children.Add(node2);
            node1.Children.Add(node11);
            node1.Children.Add(node12);
            node1.Children.Add(node13);
            node13.Children.Add(node131);
            node13.Children.Add(node132);
            node1.Children.Add(node14);
            node14.Children.Add(colorNode1);
            node14.Children.Add(colorNode2);
            node14.Children.Add(colorNode3);
            node1.Children.Add(node15);

            // Use the root node as the window's DataContext to allow data binding. The TreeView
            // will use the Children property of the DataContext as list of root tree items. This
            // property happens to be the same as each item DataTemplate uses to find its subitems.
            DataContext = rootNode;

            // Preset some node states
            node1.IsSelected  = true;
            node13.IsSelected = true;
            node14.IsExpanded = true;
        }
Esempio n. 24
0
 public FolderTreeViewItem(TreeItemViewModel parent, bool lazyLoadChildren)
     : base(parent, lazyLoadChildren)
 {
 }
Esempio n. 25
0
 private void SelectedItemChanged(object sender, RoutedPropertyChangedEventArgs <object> e)
 {
     SelectedItem = (TreeItemViewModel)e.NewValue;
 }
Esempio n. 26
0
 public ProjectTreeViewItem(TreeItemViewModel parent, bool lazyLoadChildren)
     : base(parent, lazyLoadChildren)
 {
 }
        private void WrapTreeIntoViewModels(TreeItem <FileSystemItem> tree, ObservableCollection <TreeItemViewModel> children, TreeItemViewModel parent)
        {
            foreach (var treeItem in tree.Children.Values)
            {
                var         icon = treeItem.Content.Type == ItemType.Directory ? "/Resources/Items/16x16/folder.png" : "/Resources/Items/16x16/file.png";
                BitmapImage thumbnail;
                try
                {
                    thumbnail = StfsPackageExtensions.GetBitmapFromByteArray(treeItem.Content.Thumbnail ?? ResourceManager.GetContentByteArray(icon));
                }
                catch
                {
                    thumbnail = StfsPackageExtensions.GetBitmapFromByteArray(ResourceManager.GetContentByteArray(icon));
                }

                var vm = new TreeItemViewModel(parent)
                {
                    Name        = treeItem.Name,
                    Title       = treeItem.Content.Title,
                    Content     = treeItem.Content,
                    Thumbnail   = thumbnail,
                    IsChecked   = true,
                    IsDirectory = treeItem.Content.Type == ItemType.Directory
                };
                children.Add(vm);
                WrapTreeIntoViewModels(treeItem, vm.Children, vm);
            }
        }
Esempio n. 28
0
 /// <see cref="BaseTreeCtrl.EnableMenuItems" />
 protected override void EnableMenuItems(TreeItemViewModel clickedNode)
 {
     // Context menu is currently not implemented
     Session session = Get <Session>(clickedNode);
 }
Esempio n. 29
0
        public void PopulateViewModel(ExtensionsTreeViewModel treeViewModel)
        {
            var extensions = _ecs.Extensions;

            var path = treeViewModel.SolutionPath;

            if (File.Exists(path))
            {
                path = Path.GetDirectoryName(path);
            }

            var state = new ExtensionsTreeViewModelState(treeViewModel);

            var roots = new ObservableCollection <TreeItemViewModel>();

            var projectsGroup = extensions.GroupBy(p => p.Project);
            var hierarchy     = new Stack <string>();

            foreach (var p in projectsGroup)
            {
                hierarchy.Push(Path.GetFileName(p.Key));

                var pItem = new TreeItemViewModel()
                {
                    Name       = hierarchy.Peek(),
                    IsExpanded = state.IsExpanded(hierarchy, projectsGroup.Count() == 1)
                };

                var classesGroup = p.GroupBy(c => c.Class);
                foreach (var c in classesGroup)
                {
                    hierarchy.Push(c.Key);

                    var cItem = new TreeItemViewModel()
                    {
                        Name       = hierarchy.Peek(),
                        IsExpanded = state.IsExpanded(hierarchy, classesGroup.Count() == 1)
                    };

                    foreach (var m in c)
                    {
                        hierarchy.Push(m.DisplayMethod);

                        var mItem = new TreeItemViewModel()
                        {
                            Name                    = hierarchy.Peek(),
                            ImageSource             = _extensionIconResolver.Resolve(m.Icon),
                            MouseDoubleClickCommand = _extensionMethodInvocationCommandViewModelFactory?.Invoke(m)
                        };
                        cItem.Children.Add(mItem);
                        hierarchy.Pop();
                    }

                    pItem.Children.Add(cItem);
                    hierarchy.Pop();
                }

                roots.Add(pItem);
                hierarchy.Pop();
            }

            treeViewModel.Roots = roots;
        }
Esempio n. 30
0
        public void Delete(TreeItemViewModel item)
        {
            var x = repo.FindById(item.IdNode);

            repo.Remove(x);
        }
Esempio n. 31
0
        public TreeItemViewModel Create(TreeItemViewModel item)
        {
            var newItem = repo.Create(item.Item);

            return(Convert(newItem));
        }