protected override void Reload(List <ElementTreeItem> toBeRemoved)
        {
            base.Reload(toBeRemoved);

            ResourceDictionary resources = ResourceDictionary;

            if (resources != null && resources.Count != 0)
            {
                bool foundItem = false;
                foreach (ElementTreeItem item in toBeRemoved)
                {
                    if (item.Target == resources)
                    {
                        toBeRemoved.Remove(item);
                        item.Reload();
                        foundItem = true;
                        break;
                    }
                }
                if (!foundItem)
                {
                    Children.Add(ElementTreeItem.Construct(resources, this));
                }
            }
        }
Exemple #2
0
        private void Load(object rootTarget)
        {
            _filtered.Clear();

            _root = ElementTreeItem.Construct(rootTarget, null);
            _root.Reload();
            _root.UpdateVisualChildrenCount();

            Filter = _filter;
        }
Exemple #3
0
        private void Refresh()
        {
            object currentTarget = (SelectedItem != null) ? SelectedItem.Target : null;

            _filtered.Clear();

            _root = ElementTreeItem.Construct(_rootObject, null);
            _root.Reload();
            _root.UpdateVisualChildrenCount();

            if (currentTarget != null)
            {
                SelectItem(currentTarget);
            }

            Filter = _filter;
        }
Exemple #4
0
        protected override void Reload(List <ElementTreeItem> toBeRemoved)
        {
            for (int i = 0; i < VisualTreeHelper.GetChildrenCount(Visual); i++)
            {
                DependencyObject child = VisualTreeHelper.GetChild(Visual, i);
                if (child != null)
                {
                    bool foundItem = false;
                    foreach (ElementTreeItem item in toBeRemoved)
                    {
                        if (item.Target == child)
                        {
                            toBeRemoved.Remove(item);
                            item.Reload();
                            foundItem = true;
                            break;
                        }
                    }
                    if (!foundItem)
                    {
                        Children.Add(ElementTreeItem.Construct(child, this));
                    }
                }
            }

            Grid grid = Visual as Grid;

            if (grid != null)
            {
                foreach (RowDefinition row in grid.RowDefinitions)
                {
                    Children.Add(ElementTreeItem.Construct(row, this));
                }
                foreach (ColumnDefinition column in grid.ColumnDefinitions)
                {
                    Children.Add(ElementTreeItem.Construct(column, this));
                }
            }

            base.Reload(toBeRemoved);
        }
Exemple #5
0
        protected override void Reload(List <ElementTreeItem> toBeRemoved)
        {
            base.Reload(toBeRemoved);

            if (_application.MainWindow != null)
            {
                bool foundMainWindow = false;
                foreach (ElementTreeItem item in toBeRemoved)
                {
                    if (item.Target == _application.MainWindow)
                    {
                        toBeRemoved.Remove(item);
                        item.Reload();
                        foundMainWindow = true;
                        break;
                    }
                }

                if (!foundMainWindow)
                {
                    Children.Add(ElementTreeItem.Construct(_application.MainWindow, this));
                }
            }
        }