Exemplo n.º 1
0
        public void SortBy(OutgoingSharesSortOrderType sortOption, SortOrderDirection sortDirection)
        {
            OnUiThread(() => this.ItemCollection.DisableCollectionChangedDetection());

            switch (sortOption)
            {
            case OutgoingSharesSortOrderType.ORDER_NAME:
                OnUiThread(() =>
                {
                    this.ItemCollection.Items = new ObservableCollection <IBaseNode>(this.ItemCollection.IsCurrentOrderAscending ?
                                                                                     this.ItemCollection.Items.OrderBy(item => item.Name) : this.ItemCollection.Items.OrderByDescending(item => item.Name));
                });
                break;
            }

            OnUiThread(() => this.ItemCollection.EnableCollectionChangedDetection());
        }
Exemplo n.º 2
0
        public void SortBy(ContactRerquestsSortOrderType sortOption, SortOrderDirection sortDirection)
        {
            OnUiThread(() => this.ItemCollection.DisableCollectionChangedDetection());

            switch (sortOption)
            {
            case ContactRerquestsSortOrderType.ORDER_NAME:
                OnUiThread(() =>
                {
                    this.ItemCollection.Items = new ObservableCollection <IMegaContactRequest>(this.ItemCollection.IsCurrentOrderAscending ?
                                                                                               this.ItemCollection.Items.OrderBy(item => this._isOutgoing ? item.TargetEmail : item.SourceEmail) :
                                                                                               this.ItemCollection.Items.OrderByDescending(item => this._isOutgoing ? item.TargetEmail : item.SourceEmail));
                });
                break;
            }

            OnUiThread(() => this.ItemCollection.EnableCollectionChangedDetection());
        }
Exemplo n.º 3
0
        public void SortBy(IncomingSharesSortOrderType sortOption, SortOrderDirection sortDirection)
        {
            OnUiThread(() => this.ItemCollection.DisableCollectionChangedDetection());

            switch (sortOption)
            {
            case IncomingSharesSortOrderType.ORDER_NAME:
                OnUiThread(() =>
                {
                    this.ItemCollection.Items = new ObservableCollection <IBaseNode>(this.ItemCollection.IsCurrentOrderAscending ?
                                                                                     this.ItemCollection.Items.OrderBy(item => item.Name) : this.ItemCollection.Items.OrderByDescending(item => item.Name));
                });
                break;

            case IncomingSharesSortOrderType.ORDER_MODIFICATION:
                OnUiThread(() =>
                {
                    this.ItemCollection.Items = new ObservableCollection <IBaseNode>(this.ItemCollection.IsCurrentOrderAscending ?
                                                                                     this.ItemCollection.Items.OrderBy(item => item.ModificationTime) : this.ItemCollection.Items.OrderByDescending(item => item.ModificationTime));
                });
                break;

            case IncomingSharesSortOrderType.ORDER_ACCESS:
                OnUiThread(() =>
                {
                    this.ItemCollection.Items = new ObservableCollection <IBaseNode>(this.ItemCollection.IsCurrentOrderAscending ?
                                                                                     this.ItemCollection.Items.OrderBy(item => (item as IMegaIncomingSharedFolderNode).AccessLevel.AccessType) :
                                                                                     this.ItemCollection.Items.OrderByDescending(item => (item as IMegaIncomingSharedFolderNode).AccessLevel.AccessType));
                });
                break;

            case IncomingSharesSortOrderType.ORDER_OWNER:
                OnUiThread(() =>
                {
                    this.ItemCollection.Items = new ObservableCollection <IBaseNode>(this.ItemCollection.IsCurrentOrderAscending ?
                                                                                     this.ItemCollection.Items.OrderBy(item => (item as IMegaIncomingSharedFolderNode).Owner) :
                                                                                     this.ItemCollection.Items.OrderByDescending(item => (item as IMegaIncomingSharedFolderNode).Owner));
                });
                break;
            }

            OnUiThread(() => this.ItemCollection.EnableCollectionChangedDetection());
        }
Exemplo n.º 4
0
        public void SortBy(ContactsSortOrderType sortOption, SortOrderDirection sortDirection)
        {
            OnUiThread(() => this.ItemCollection.DisableCollectionChangedDetection());

            switch (sortOption)
            {
            case ContactsSortOrderType.ORDER_NAME:
                OnUiThread(() =>
                {
                    this.ItemCollection.Items = new ObservableCollection <IMegaContact>(this.ItemCollection.IsCurrentOrderAscending ?
                                                                                        this.ItemCollection.Items.OrderBy(item => item.FullName ?? item.Email) :
                                                                                        this.ItemCollection.Items.OrderByDescending(item => item.FullName ?? item.Email));
                });
                break;

            case ContactsSortOrderType.ORDER_EMAIL:
                OnUiThread(() =>
                {
                    this.ItemCollection.Items = new ObservableCollection <IMegaContact>(this.ItemCollection.IsCurrentOrderAscending ?
                                                                                        this.ItemCollection.Items.OrderBy(item => item.Email) :
                                                                                        this.ItemCollection.Items.OrderByDescending(item => item.Email));
                });
                break;

            case ContactsSortOrderType.ORDER_STATUS:
                OnUiThread(() =>
                {
                    this.ItemCollection.Items = new ObservableCollection <IMegaContact>(this.ItemCollection.IsCurrentOrderAscending ?
                                                                                        this.ItemCollection.Items.OrderBy(item => item.ReferralStatusOrder)
                                                                                        .ThenBy(item => item.ReferralBonusExpiresIn) :
                                                                                        this.ItemCollection.Items.OrderByDescending(item => item.ReferralStatusOrder)
                                                                                        .ThenByDescending(item => item.ReferralBonusExpiresIn));
                });
                break;
            }

            OnUiThread(() => this.ItemCollection.EnableCollectionChangedDetection());

            this.CloseContactProfile();
        }