public static void AddHistoryItemAsync(string historyPath, HistoryItem historyItem)
 {
     TaskEx.Run(() =>
     {
         HistoryManager history = new HistoryManager(historyPath);
         history.AppendHistoryItem(historyItem);
     });
 }
Ejemplo n.º 2
0
        private void RefreshHistoryItems()
        {
            if (history == null)
            {
                history = new HistoryManager(HistoryPath);
            }

            allHistoryItems = GetHistoryItems();
            ApplyFiltersAndAdd();
        }
Ejemplo n.º 3
0
        private void RefreshHistoryItems()
        {
            if (history == null)
            {
                history = new HistoryManager(HistoryPath);
            }

            allHistoryItems = GetHistoryItems();
            ApplyFiltersAndAdd();
        }
Ejemplo n.º 4
0
        private HistoryItem[] GetHistoryItems()
        {
            if (history == null)
            {
                history = new HistoryManagerJSON(HistoryPath);
            }

            List <HistoryItem> historyItems = history.GetHistoryItems();

            historyItems.Reverse();
            return(historyItems.ToArray());
        }
Ejemplo n.º 5
0
        private void RefreshHistoryItems()
        {
            if (history == null)
            {
                history = new HistoryManager(HistoryPath);
            }

            historyItems = GetHistoryItems();

            ilvImages.Items.Clear();
            ImageListViewItem[] ilvItems = historyItems.Select(historyItem => new ImageListViewItem(historyItem.Filepath)
            {
                Tag = historyItem
            }).ToArray();
            ilvImages.Items.AddRange(ilvItems);
        }
Ejemplo n.º 6
0
        private void RefreshHistoryItems()
        {
            SearchText = tstbSearch.Text;

            if (history == null)
            {
                history = new HistoryManager(HistoryPath);
            }

            ilvImages.Items.Clear();
            ImageListViewItem[] ilvItems = GetHistoryItems().Select(hi => new ImageListViewItem(hi.Filepath)
            {
                Tag = hi
            }).ToArray();
            ilvImages.Items.AddRange(ilvItems);
        }
Ejemplo n.º 7
0
        private HistoryItem[] GetHistoryItems()
        {
            if (history == null)
            {
                history = new HistoryManager(HistoryPath);
            }

            IEnumerable <HistoryItem> tempHistoryItems = history.GetHistoryItems();

            tempHistoryItems = tempHistoryItems.Reverse();

            if (Settings.MaxItemCount > 0)
            {
                tempHistoryItems = tempHistoryItems.Take(Settings.MaxItemCount);
            }

            return(tempHistoryItems.ToArray());
        }
Ejemplo n.º 8
0
        private IEnumerable <HistoryItem> GetHistoryItems()
        {
            if (history == null)
            {
                history = new HistoryManagerJSON(HistoryPath);
            }

            List <HistoryItem> historyItems         = history.GetHistoryItems();
            List <HistoryItem> filteredHistoryItems = new List <HistoryItem>();

            Regex regex = null;

            if (!string.IsNullOrEmpty(SearchText))
            {
                string pattern = Regex.Escape(SearchText).Replace("\\?", ".").Replace("\\*", ".*");
                regex = new Regex(pattern, RegexOptions.Compiled | RegexOptions.IgnoreCase | RegexOptions.CultureInvariant);
            }

            for (int i = historyItems.Count - 1; i >= 0; i--)
            {
                HistoryItem hi = historyItems[i];

                if (!string.IsNullOrEmpty(hi.FilePath) && Helpers.IsImageFile(hi.FilePath) &&
                    (regex == null || regex.IsMatch(hi.FileName) || (SearchInTags && hi.Tags != null && hi.Tags.Any(tag => regex.IsMatch(tag.Value)))) &&
                    (!Settings.FilterMissingFiles || File.Exists(hi.FilePath)))
                {
                    filteredHistoryItems.Add(hi);

                    if (Settings.MaxItemCount > 0 && filteredHistoryItems.Count >= Settings.MaxItemCount)
                    {
                        break;
                    }
                }
            }

            UpdateTitle(historyItems.Count, filteredHistoryItems.Count);

            return(filteredHistoryItems);
        }
Ejemplo n.º 9
0
        private void RefreshHistoryItems()
        {
            if (history == null)
            {
                history = new HistoryManager(HistoryPath);
            }

            historyItems = GetHistoryItems();

            ilvImages.Items.Clear();
            ImageListViewItem[] ilvItems = historyItems.Select(historyItem => new ImageListViewItem(historyItem.Filepath) { Tag = historyItem }).ToArray();
            ilvImages.Items.AddRange(ilvItems);
        }