private void AddCurrentWithMeItem(SharedWithMeViewModel item)
 {
     CurrentSharesWithMe.Add(item);
     RaisePropertyChanged("CurrentSharesWithMe");
     RaisePropertyChanged("CurrentSharesCount");
     RaisePropertyChanged("IsAnyCurrentSharesWithMe");
 }
 private void AddPendingWithMeItem(SharedWithMeViewModel item)
 {
     PendingSharesWithMe.Add(item);
     RaisePropertyChanged("PendingSharesWithMe");
     RaisePropertyChanged("IsAnyPendingSharesWithMe");
     RaisePropertyChanged("PendingSharesWithMeCount");
 }
        private void Test3(IEnumerable <object> items, bool isPending)
        {
            if (items == null)
            {
                return;
            }

            var shareWith = new List <SharedWithViewModel>
            {
                new SharedWithViewModel("*****@*****.**", ShareWithStatus.Accepted),
                new SharedWithViewModel("*****@*****.**", ShareWithStatus.Declined),
                new SharedWithViewModel("*****@*****.**", ShareWithStatus.Pending)
            };

            var lst = items.Count() > 2
                ? items.ToList().GetRange(0, 2)
                : items.ToList();

            var pendingFolder = new ShareFolderViewModel("1", "First folder", null, true);
            var subFolder     = new ShareFolderViewModel("2", "Sub-folder", null, true);

            foreach (var subItem in lst)
            {
                subFolder.AddSubItem(subItem);
            }
            pendingFolder.AddSubItem(subFolder);
            foreach (var subItem in lst)
            {
                pendingFolder.AddSubItem(subItem);
            }
            var pendingShareWithSubFolder = new SharedByMeViewModel(Guid.NewGuid().ToString(), "Share with sub-folder", true, lst, shareWith, true);

            pendingShareWithSubFolder.AddItem(pendingFolder);

            //shared with me
            var sharedSubItems = new SharedWithMeItemShareViewModel(Guid.NewGuid().ToString(), "First sub-item", isPending, lst, false,
                                                                    new DateTime(2016, 3, 23), SharedWithMeItemState.Pending);

            sharedSubItems.AddItem(subFolder);
            var sharedSubItems2 = new SharedWithMeItemShareViewModel(Guid.NewGuid().ToString(), "Second sub-item", isPending, lst, false,
                                                                     new DateTime(2016, 5, 22), SharedWithMeItemState.Waiting);
            var shareWithMe = new SharedWithMeViewModel(Guid.NewGuid().ToString(), "sender-email-address.com", isPending,
                                                        new List <object> {
                sharedSubItems, sharedSubItems2
            }, false);

            if (isPending)
            {
                AddPendingByMeItem(pendingShareWithSubFolder);
            }
            else
            {
                AddCurrentByMeItem(pendingShareWithSubFolder);
                AddCurrentWithMeItem(shareWithMe);
            }
        }
        private void Test1(IEnumerable <SecureItemViewModel> items, bool isPending)
        {
            if (items == null)
            {
                return;
            }

            var shareWith = new List <SharedWithViewModel>
            {
                new SharedWithViewModel("*****@*****.**", ShareWithStatus.Accepted),
                new SharedWithViewModel("*****@*****.**", ShareWithStatus.Declined),
                new SharedWithViewModel("*****@*****.**", ShareWithStatus.Pending)
            };

            var lst = items.Count() > 2
                ? items.ToList().GetRange(0, 2)
                : items.ToList();
            var pendingShareWithoutFolder = new SharedByMeViewModel(Guid.NewGuid().ToString(), "Pending share name", true, lst, shareWith, isPending);
            //pending shared with me
            var sharedSubItems = new SharedWithMeItemShareViewModel(Guid.NewGuid().ToString(), "First sub-item", isPending, lst, false,
                                                                    new DateTime(2016, 3, 23), SharedWithMeItemState.Pending);
            var sharedSubItems2 = new SharedWithMeItemShareViewModel(Guid.NewGuid().ToString(), "Second sub-item", isPending, lst, false,
                                                                     new DateTime(2016, 5, 22), SharedWithMeItemState.Waiting);
            var pendingShareWithMe = new SharedWithMeViewModel(Guid.NewGuid().ToString(), "sender-email-address.com", isPending,
                                                               new List <object> {
                sharedSubItems, sharedSubItems2
            }, false);

            if (isPending)
            {
                AddPendingByMeItem(pendingShareWithoutFolder);
                AddPendingWithMeItem(pendingShareWithMe);
            }
            else
            {
                AddCurrentByMeItem(pendingShareWithoutFolder);
                AddCurrentWithMeItem(pendingShareWithMe);
            }
        }