Exemple #1
0
        private void LoadListView([NotNull] List <JobItem> items)
        {
            Debug.ArgumentNotNull(items, nameof(items));

            Items = items;

            var list = new List <JobItem>();

            foreach (var jobItem in items)
            {
                if (jobItem.Name.IsFilterMatch(IncludeFilter.Text))
                {
                    list.Add(jobItem);
                }
            }

            ListView.ItemsSource = list;

            _listViewSorter.Resort();

            LastUpdate.Text = DateTime.Now.ToString(CultureInfo.CurrentCulture);

            StartLog.IsEnabled   = true;
            PauseLog.IsEnabled   = true;
            RefreshLog.IsEnabled = true;

            if (IsRunning)
            {
                Start();
            }
        }
Exemple #2
0
        public void Load(List <ItemHeader> items)
        {
            Assert.ArgumentNotNull(items, nameof(items));

            Hits.ItemsSource = new ListCollectionView(items);

            listViewSorter.Resort();
        }
        private void LoadItems()
        {
            var list = new List <ItemHeader>();

            ApplyFilters(list);

            Items.ItemsSource = list;

            listViewSorter.Resort();
        }
Exemple #4
0
        private void LoadItems()
        {
            var list = new List <ArchiveEntry>();

            ApplyFilters(list);

            ArchiveEntries.ItemsSource = list;

            _listViewSorter.Resort();
        }
        private void LoadTemplates([NotNull] IEnumerable <TemplateHeader> templates)
        {
            Debug.ArgumentNotNull(templates, nameof(templates));

            TemplateListView.ItemsSource = templates;

            _listViewSorter.Resort();
            _view = CollectionViewSource.GetDefaultView(templates) as CollectionView;
            if (_view == null)
            {
                return;
            }

            var groupDescription = new PropertyGroupDescription("Section")
            {
                StringComparison = StringComparison.InvariantCultureIgnoreCase
            };

            var collection = _view.GroupDescriptions;

            if (collection != null)
            {
                collection.Clear();
                collection.Add(groupDescription);
            }

            _view.Filter = delegate(object o)
            {
                var templateHeader = o as TemplateHeader;
                if (templateHeader == null)
                {
                    return(false);
                }

                return(templateHeader.Name.IsFilterMatch(FilterTextBox.Text));
            };

            _view.Refresh();

            TemplateListView.ResizeColumn(NameColumn);

            Loading.Visibility = Visibility.Collapsed;
            Stack.Visibility   = Visibility.Visible;

            var selectedItem = templates.FirstOrDefault(t => t.TemplateId == InitialTemplateId);

            TemplateListView.SelectedItem = selectedItem;
            if (selectedItem != null)
            {
                TemplateListView.ScrollIntoView(selectedItem);
            }
        }
Exemple #6
0
        public void ShowFileList()
        {
            FileList.ItemsSource = null;
            FileList.ItemsSource = Files;

            fileListSorter.Resort();

            NoFiles.Visibility       = Visibility.Collapsed;
            FileListPanel.Visibility = Visibility.Visible;

            FileList.ResizeColumn(FileNameColumn);
            FileList.ResizeColumn(FolderPathColumn);
        }
Exemple #7
0
        public void ShowItemList()
        {
            ItemList.ItemsSource = null;
            ItemList.ItemsSource = Items;

            itemListSorter.Resort();

            NoItems.Visibility       = Visibility.Collapsed;
            ItemListPanel.Visibility = Visibility.Visible;

            ItemList.ResizeColumn(ItemNameColumn);
            ItemList.ResizeColumn(ItemPathColumn);
            ItemList.ResizeColumn(ItemTemplateColumn);
            ItemList.ResizeColumn(ItemDatabaseColumn);
        }
        private void RenderSites()
        {
            SiteList.ItemsSource = null;
            SiteList.ItemsSource = sites;
            listViewSorter.Resort();

            ResizeGridViewColumn(NameColumn);
            ResizeGridViewColumn(HostNameColumn);
            ResizeGridViewColumn(DatabaseColumn);
            ResizeGridViewColumn(DomainColumn);

            if (sites.Count > 0)
            {
                SiteList.SelectedIndex = 0;
            }
        }
Exemple #9
0
        private void LoadRenderings([NotNull] IEnumerable <ItemHeader> items)
        {
            Debug.ArgumentNotNull(items, nameof(items));

            RenderingsListView.ItemsSource = items;

            listViewSorter.Resort();
            view = CollectionViewSource.GetDefaultView(items) as CollectionView;
            if (view == null)
            {
                return;
            }

            var groupDescription = new PropertyGroupDescription("ParentPath")
            {
                StringComparison = StringComparison.InvariantCultureIgnoreCase
            };

            var collection = view.GroupDescriptions;

            if (collection != null)
            {
                collection.Clear();
                collection.Add(groupDescription);
            }

            view.Filter = delegate(object o)
            {
                var itemHeader = o as ItemHeader;
                if (itemHeader == null)
                {
                    return(false);
                }

                return(itemHeader.Name.IsFilterMatch(FilterTextBox.Text));
            };

            view.Refresh();

            RenderingsListView.ResizeColumn(NameColumn);
            RenderingsListView.ResizeColumn(TemplateNameColumn);

            Loading.Visibility = Visibility.Collapsed;
            Stack.Visibility   = Visibility.Visible;
        }
        private void LoadChunks()
        {
            var renderingChunkManager = AppHost.Container.Get <RenderingChunkManager>();

            renderingChunkManager.Refresh();

            var items = renderingChunkManager.RenderingChunks.ToList();

            ChunksListView.ItemsSource = items;

            listViewSorter.Resort();
            view = CollectionViewSource.GetDefaultView(items) as CollectionView;
            if (view == null)
            {
                return;
            }

            var groupDescription = new PropertyGroupDescription("Group")
            {
                StringComparison = StringComparison.InvariantCultureIgnoreCase
            };

            var collection = view.GroupDescriptions;

            if (collection != null)
            {
                collection.Clear();
                collection.Add(groupDescription);
            }

            view.Filter = delegate(object o)
            {
                var itemHeader = o as IRenderingChunk;
                if (itemHeader == null)
                {
                    return(true);
                }

                return(itemHeader.Name.IsFilterMatch(FilterTextBox.Text));
            };

            view.Refresh();

            ChunksListView.ResizeColumn(NameColumn);
        }
Exemple #11
0
        private void LoadHits()
        {
            Hits.Visibility    = Visibility.Collapsed;
            NoHits.Visibility  = Visibility.Collapsed;
            NoItems.Visibility = Visibility.Collapsed;
            NoQuery.Visibility = Visibility.Collapsed;

            var list = new List <ItemHeader>();

            ApplyFilters(list);

            Hits.ItemsSource = new ListCollectionView(list);

            if (list.Count == 0)
            {
                NoItems.Visibility = Visibility.Visible;
                return;
            }

            listViewSorter.Resort();

            Hits.Visibility = Visibility.Visible;
        }