コード例 #1
0
        public async Task LoadCurrentlyShownElements(IEnumerable <Tag> tags)
        {
            if (CurrentlyOpenedElement == null)
            {
                return;
            }
            if (!(CurrentlyOpenedElement is Library))
            {
                return;
            }

            CurrentlyShownElements.Clear();

            if (CurrentlyOpenedElement.Origin == Origin.Local)
            {
                foreach (var i in (CurrentlyOpenedElement as Library).Images)
                {
                    foreach (var t in tags)
                    {
                        if (i.Tags.Contains(t))
                        {
                            await Task.Run(() => CurrentlyShownElements.Add(i));
                        }
                    }
                }
            }

            //TODO: Add icons to imageFiles from diffrent origins than local
        }
コード例 #2
0
        public async Task LoadCurrentlyShownElementsAsync()
        {
            if (CurrentlyShownElements == null)
            {
                return;
            }

            CurrentlyShownElements.Clear();

            if (CurrentlyOpenedElement == null)
            {
                var libraries = await LibraryRepository.GetAllAsync();

                foreach (IExplorableElement t in libraries)
                {
                    CurrentlyShownElements.Add(t);
                }
            }
            else if (CurrentlyOpenedElement is Library)
            {
                if (CurrentlyOpenedElement.Origin == Origin.Local)
                {
                    foreach (var t in (CurrentlyOpenedElement as Library).Images)
                    {
                        CurrentlyShownElements.Add(t);
                    }
                }

                //TODO: Add icons to imageFiles from diffrent origins than local
            }
        }