Exemplo n.º 1
0
        public CardItemSorter(Label sortTypeLabel, ObservableCollection <ISortableCardItem> cardItemCollection)
        {
            this.sortTypeLabel      = sortTypeLabel;
            this.cardItemCollection = cardItemCollection;

            if (sortTypeLabel.Text != null)
            {
                doSort(sortTypeLabel.Text);
            }
            else
            {
                ObservableCollectionSorter.Sort <ISortableCardItem>(cardItemCollection, new CardItemDateComparer(true));
                sortTypeLabel.Text = "earliest";
            }
        }
Exemplo n.º 2
0
        public CardMediaObservableCollection(Dir card) : base()
        {
            this.card = card;

            mediaTypesToShow = new List <MediaContentType>()
            {
                MediaContentType.Image, MediaContentType.Video, MediaContentType.Audio, MediaContentType.Note
            };

            foreach (var mediaCollection in card.getAllMediaLists())
            {
                this.addParentCollection(mediaCollection);
            }

            ObservableCollectionSorter.Sort <AbMediaContent>(this, new CardItemDateComparer <AbMediaContent>(true));
        }
Exemplo n.º 3
0
        public void doSort(bool sortAscending, SortType sortType)
        {
            this.sortAscending = sortAscending;
            this.sortType      = sortType;

            switch (sortType)
            {
            case SortType.Alphabetically:
                ObservableCollectionSorter.Sort <T>(cardItemCollection, new CardItemNameComparer <T>(sortAscending));
                break;

            case SortType.ModTime:
                ObservableCollectionSorter.Sort <T>(cardItemCollection, new CardItemDateComparer <T>(sortAscending));
                break;

            default:
                break;
            }
        }
Exemplo n.º 4
0
        private void doSort(string sortType)
        {
            switch (sortType)
            {
            case "earliest":
                ObservableCollectionSorter.Sort <ISortableCardItem>(cardItemCollection, new CardItemDateComparer(true));
                break;

            case "latest":
                ObservableCollectionSorter.Sort <ISortableCardItem>(cardItemCollection, new CardItemDateComparer(false));
                break;

            case "A-Z":
                ObservableCollectionSorter.Sort <ISortableCardItem>(cardItemCollection, new CardItemNameComparer(true));
                break;

            case "Z-A":
                ObservableCollectionSorter.Sort <ISortableCardItem>(cardItemCollection, new CardItemNameComparer(false));
                break;

            default:
                break;
            }
        }