Exemple #1
0
        public void Update()
        {
            _header.Text = string.Format("{0} ({1})", _value.SearchItem.Name, _hit);

            base.IsExpanded = this.Value.IsExpanded;

            foreach (var item in _listViewItemCollection.OfType <SearchTreeViewItem>().ToArray())
            {
                if (!_value.Children.Any(n => object.ReferenceEquals(n, item.Value)))
                {
                    _listViewItemCollection.Remove(item);
                }
            }

            foreach (var item in _value.Children)
            {
                if (!_listViewItemCollection.OfType <SearchTreeViewItem>().Any(n => object.ReferenceEquals(n.Value, item)))
                {
                    var treeViewItem = new SearchTreeViewItem(item);
                    treeViewItem.Parent = this;

                    _listViewItemCollection.Add(treeViewItem);
                }
            }

            this.Sort();
        }
Exemple #2
0
        public void Update()
        {
            _header.Text = this.Value.Signature;

            foreach (var item in _listViewItemCollection.OfType <BoxTreeViewItem>().ToArray())
            {
                if (!_value.Boxes.Any(n => object.ReferenceEquals(n, item.Value)))
                {
                    _listViewItemCollection.Remove(item);
                }
            }

            foreach (var item in _value.Boxes)
            {
                if (!_listViewItemCollection.OfType <BoxTreeViewItem>().Any(n => object.ReferenceEquals(n.Value, item)))
                {
                    var treeViewItem = new BoxTreeViewItem(item);
                    treeViewItem.Parent = this;

                    _listViewItemCollection.Add(treeViewItem);
                }
            }

            this.Sort();
        }
        public void Update()
        {
            _header.Text = this.Value.Name;

            base.IsExpanded = this.Value.IsExpanded;

            foreach (var item in _listViewItemCollection.OfType <StoreCategorizeTreeViewItem>().ToArray())
            {
                if (!_value.Children.Any(n => object.ReferenceEquals(n, item.Value)))
                {
                    _listViewItemCollection.Remove(item);
                }
            }

            foreach (var item in _value.Children)
            {
                if (!_listViewItemCollection.OfType <StoreCategorizeTreeViewItem>().Any(n => object.ReferenceEquals(n.Value, item)))
                {
                    var treeViewItem = new StoreCategorizeTreeViewItem(item);
                    treeViewItem.Parent = this;

                    _listViewItemCollection.Add(treeViewItem);
                }
            }

            foreach (var item in _listViewItemCollection.OfType <StoreTreeViewItem>().ToArray())
            {
                if (!_value.StoreTreeItems.Any(n => object.ReferenceEquals(n, item.Value)))
                {
                    _listViewItemCollection.Remove(item);
                }
            }

            foreach (var item in _value.StoreTreeItems)
            {
                if (!_listViewItemCollection.OfType <StoreTreeViewItem>().Any(n => object.ReferenceEquals(n.Value, item)))
                {
                    var treeViewItem = new StoreTreeViewItem(item);
                    treeViewItem.Parent = this;

                    _listViewItemCollection.Add(treeViewItem);
                }
            }

            this.Sort();
        }
Exemple #4
0
        public void Update()
        {
            this.NotifyPropertyChanged(nameof(this.Name));
            this.NotifyPropertyChanged(nameof(this.IsExpanded));

            foreach (var item in _children.OfType <StoreCategorizeTreeViewModel>().ToArray())
            {
                if (!_value.Children.Any(n => object.ReferenceEquals(n, item.Value)))
                {
                    _children.Remove(item);
                }
            }

            foreach (var item in _value.Children)
            {
                if (!_children.OfType <StoreCategorizeTreeViewModel>().Any(n => object.ReferenceEquals(n.Value, item)))
                {
                    _children.Add(new StoreCategorizeTreeViewModel(this, item));
                }
            }

            foreach (var item in _children.OfType <StoreTreeViewModel>().ToArray())
            {
                if (!_value.StoreTreeItems.Any(n => object.ReferenceEquals(n, item.Value)))
                {
                    _children.Remove(item);
                }
            }

            foreach (var item in _value.StoreTreeItems)
            {
                if (!_children.OfType <StoreTreeViewModel>().Any(n => object.ReferenceEquals(n.Value, item)))
                {
                    _children.Add(new StoreTreeViewModel(this, item));
                }
            }

            this.Sort();
        }
Exemple #5
0
        public void Update()
        {
            this.Update_Header();

            foreach (var item in _children.OfType <BoxTreeViewModel>().ToArray())
            {
                if (!_value.Boxes.Any(n => object.ReferenceEquals(n, item.Value)))
                {
                    _children.Remove(item);
                }
            }

            foreach (var item in _value.Boxes)
            {
                if (!_children.OfType <BoxTreeViewModel>().Any(n => object.ReferenceEquals(n.Value, item)))
                {
                    _children.Add(new BoxTreeViewModel(this, item));
                }
            }

            this.Sort();
        }