public AllProfilePostsToggleViewModel(IProfileData profileData, bool isAllPosts = true)
        {
            this.AllPostsText = CommonResources.Group_AllPosts;
            //
            this._profileData         = profileData;
            this._isAllPosts          = isAllPosts;
            this.PostsCountVisibility = Visibility.Collapsed;
            GroupData profileData1 = this._profileData as GroupData;

            if (profileData1 != null)
            {
                if (profileData1.group != null && (profileData1.group.GroupType == GroupType.PublicPage || !profileData1.group.CanSeeAllPosts))
                {
                    this._hidePostsUnderline   = true;
                    this.AllPostsText          = UIStringFormatterHelper.FormatNumberOfSomething(profileData1.wallPostsCount, CommonResources.OneWallPostFrm, CommonResources.TwoWallPostsFrm, CommonResources.FiveWallPostsFrm, true, null, false);
                    this.PostsCountVisibility  = Visibility.Visible;
                    this.PostsToggleVisibility = Visibility.Collapsed;
                }
                else
                {
                    this.ProfilePostsText = CommonResources.Group_CommunityPosts;
                }
            }
            else
            {
                this.ProfilePostsText = AppGlobalStateManager.Current.LoggedInUserId == this._profileData.Id ? CommonResources.User_MyPosts : string.Format(CommonResources.User_ProfilePostsFrm, this._profileData.NameGen);
            }
        }
Exemplo n.º 2
0
        private void UpdateAttachPhotoItem()
        {
            int number = Enumerable.Count <AlbumPhoto>(this._viewModel.PhotosVM.AlbumPhotos, (Func <AlbumPhoto, bool>)(p => p.IsSelected));

            this._albumPhotosSelected = number > 0;
            AttachmentPickerItemViewModel pickerItemViewModel = (AttachmentPickerItemViewModel)Enumerable.FirstOrDefault <AttachmentPickerItemViewModel>(this._viewModel.AttachmentTypes, (Func <AttachmentPickerItemViewModel, bool>)(at => at.AttachmentType.AttachmentType == AttachmentType.Photo));

            if (pickerItemViewModel == null)
            {
                return;
            }
            if (this._albumPhotosSelected)
            {
                if (this._savedText == "")
                {
                    this._savedText = pickerItemViewModel.Title;
                }
                pickerItemViewModel.Title         = UIStringFormatterHelper.FormatNumberOfSomething(number, CommonResources.AttachOnePhotoFrm, CommonResources.AttachTwoFourPhotosFrm, CommonResources.AttachFivePhotosFrm, true, null, false);
                pickerItemViewModel.IsHighlighted = true;
            }
            else
            {
                pickerItemViewModel.Title         = this._savedText;
                pickerItemViewModel.IsHighlighted = false;
            }
        }
Exemplo n.º 3
0
        private void ProcessInputParameters()
        {
            AudioAlbum pickedAlbum = ParametersRepository.GetParameterForIdAndReset("PickedAlbum") as AudioAlbum;

            if (pickedAlbum == null || !this.IsInMultiSelectMode)
            {
                return;
            }
            List <AudioHeader> headersToMove = this.GetSelectedAudioHeaders();

            this.IsInMultiSelectMode = false;
            this.ViewModel.MoveTracksToAlbum(headersToMove, pickedAlbum, (Action <bool>)(result => Execute.ExecuteOnUIThread((Action)(() =>
            {
                if (!result)
                {
                    ExtendedMessageBox.ShowSafe(CommonResources.GenericErrorText);
                }
                else
                {
                    if (MessageBox.Show(UIStringFormatterHelper.FormatNumberOfSomething(headersToMove.Count, AudioResources.OneAudioMovedFrm, AudioResources.TwoFourAudiosMovedFrm, AudioResources.FiveAudiosMovedFrm, true, pickedAlbum.title, false), AudioResources.MoveAudios, MessageBoxButton.OKCancel) != MessageBoxResult.OK)
                    {
                        return;
                    }
                    Navigator.Current.NavigateToAudio(0, this.CommonParameters.UserOrGroupId, this.CommonParameters.IsGroup, pickedAlbum.album_id, 0, pickedAlbum.title);
                }
            }))));
        }
Exemplo n.º 4
0
        private static string GetSubtitle(User user, bool includeCommonFriendsInfo)
        {
            if (user.description != null)
            {
                return(user.description);
            }
            if (includeCommonFriendsInfo && user.common_count > 0)
            {
                return(UIStringFormatterHelper.FormatNumberOfSomething(user.common_count, CommonResources.OneCommonFriendFrm, CommonResources.TwoFourCommonFriendsFrm, CommonResources.FiveCommonFriendsFrm, true, null, false));
            }
            Occupation occupation = user.occupation;

            if (occupation != null && !string.IsNullOrEmpty(occupation.name))
            {
                return(occupation.name);
            }
            City    city    = user.city;
            Country country = user.country;

            if (city != null && !string.IsNullOrEmpty(city.name))
            {
                string name = city.name;
                if (country != null && !string.IsNullOrEmpty(country.name))
                {
                    name += string.Format(", {0}", (object)country.name);
                }
                return(name);
            }
            if (country != null && !string.IsNullOrEmpty(country.name))
            {
                return(country.name);
            }
            return("");
        }
Exemplo n.º 5
0
 public void UpdateDataView(FriendRequests model)
 {
     this._model = model;
     if (this._model == null || model.count == 0)
     {
         return;
     }
     if (!model.are_suggested_friends)
     {
         this.TitleBlock.Text = (UIStringFormatterHelper.FormatNumberOfSomething(model.count, CommonResources.OneFriendRequestFrm, CommonResources.TwoFourFriendRequestsFrm, CommonResources.FiveFriendRequestsFrm, true, null, false));
     }
     else
     {
         this.TitleBlock.Text = (UIStringFormatterHelper.FormatNumberOfSomething(model.count, CommonResources.SuggestedFriendOneFrm, CommonResources.SuggestedFriendTwoFrm, CommonResources.SuggestedFriendFiveFrm, true, null, false));
     }
     ((UIElement)this.ShowAllBlock).Visibility = (model.count > 1 ? Visibility.Visible : Visibility.Collapsed);
     if (model.requests[0].RequestHandledAction == null)
     {
         model.requests[0].RequestHandledAction = (Action <FriendRequests>)(requests => ((FriendsViewModel)base.DataContext).RequestsViewModel = requests);
     }
     this.RequestView.Content = (new FriendRequestUC()
     {
         Model = model.requests[0],
         Profiles = model.profiles.ToArray(),
         IsSuggestedFriend = new bool?(model.are_suggested_friends)
     });
 }
 public string GetFooterTextForCount(GenericCollectionViewModel2 <VKList <Product>, TwoInARowItemViewModel <Product> > caller, int count)
 {
     if (this._productsCount <= 0)
     {
         return(CommonResources.NoProducts);
     }
     return(UIStringFormatterHelper.FormatNumberOfSomething(this._productsCount, CommonResources.OneProductFrm, CommonResources.TwoFourProductsFrm, CommonResources.FiveProductsFrm, true, null, false));
 }
Exemplo n.º 7
0
 public string GetFooterTextForCount(GenericCollectionViewModel <VKList <User>, LinkHeader> caller, int count)
 {
     if (count <= 0)
     {
         return(CommonResources.NoInvitations);
     }
     return(UIStringFormatterHelper.FormatNumberOfSomething(count, CommonResources.Communities_InvitationOneFrm, CommonResources.Communities_InvitationTwoFrm, CommonResources.Communities_InvitationFiveFrm, true, (string)null, false));
 }
Exemplo n.º 8
0
 public string GetFooterTextForCount(GenericCollectionViewModel <WallData, IVirtualizable> caller, int count)
 {
     if (count <= 0)
     {
         return(CommonResources.NoWallPosts);
     }
     return(UIStringFormatterHelper.FormatNumberOfSomething(count, CommonResources.OneWallPostFrm, CommonResources.TwoWallPostsFrm, CommonResources.FiveWallPostsFrm, true, null, false));
 }
Exemplo n.º 9
0
 public string GetFooterTextForCount(GenericCollectionViewModel <PhotosListWithCount, AlbumPhotoHeaderFourInARow> caller, int count)
 {
     if (count <= 0)
     {
         return(CommonResources.NoPhotos);
     }
     return(UIStringFormatterHelper.FormatNumberOfSomething(count, CommonResources.OnePhotoFrm, CommonResources.TwoFourPhotosFrm, CommonResources.FivePhotosFrm, true, null, false));
 }
Exemplo n.º 10
0
 public string GetFooterTextForCount(GenericCollectionViewModel2 <MarketFeedResponse, MarketFeedItem> caller, int count)
 {
     if (this._productsCount == 0)
     {
         return(CommonResources.NoProducts);
     }
     return(UIStringFormatterHelper.FormatNumberOfSomething(this._productsCount, CommonResources.OneProductFrm, CommonResources.TwoFourProductsFrm, CommonResources.FiveProductsFrm, true, null, false));
 }
 public string GetFooterTextForCount(GenericCollectionViewModel <TopicsInfo, ThemeHeader> caller, int count)
 {
     if (count <= 0)
     {
         return(GroupResources.NoTopics);
     }
     return(UIStringFormatterHelper.FormatNumberOfSomething(count, GroupResources.OneTopicFrm, GroupResources.TwoFourTopicsFrm, GroupResources.FiveTopicsFrm, true, null, false));
 }
 public string GetFooterTextForCount(GenericCollectionViewModel <VKList <ConversationMaterial>, AudioHeader> caller, int count)
 {
     if (count <= 0)
     {
         return(AudioResources.NoTracks);
     }
     return(UIStringFormatterHelper.FormatNumberOfSomething(count, AudioResources.OneTrackFrm, AudioResources.TwoFourTracksFrm, AudioResources.FiveTracksFrm, true, null, false));
 }
 public static string GetTextFor(int numberToReload)
 {
     if (numberToReload == 1)
     {
         return(CommonResources.PostCommentsPage_PreviousComment);
     }
     return(string.Format(UIStringFormatterHelper.FormatNumberOfSomething(numberToReload, CommonResources.PostCommentsPage_PreviousOneCommentsFrm, CommonResources.PostCommentsPage_PreviousTwoFourCommentsFrm, CommonResources.PostCommentsPage_PreviousFiveCommentsFrm, true, null, false), (object)numberToReload));
 }
Exemplo n.º 14
0
 public string GetFooterTextForCount(GenericCollectionViewModel <VKList <MoneyTransfer>, MoneyTransferViewModel> caller, int count)
 {
     if (count <= 0)
     {
         return(CommonResources.NoTransfers);
     }
     return(UIStringFormatterHelper.FormatNumberOfSomething(count, CommonResources.OneTransferForm, CommonResources.TwoFourTransfersForm, CommonResources.FiveTransfersForm, true, null, false));
 }
Exemplo n.º 15
0
 public static string FormatPhotosCountString(int PhotosCount)
 {
     if (PhotosCount == 0)
     {
         return(PhotoResources.PhotoAlbumPage_NoPhotos);
     }
     return(UIStringFormatterHelper.FormatNumberOfSomething(PhotosCount, PhotoResources.AlbumsPhotosCountOneFrm, PhotoResources.AlbumsPhotosCountTwoFrm, PhotoResources.AlbumsPhotosCountFiveFrm, true, null, false));
 }
Exemplo n.º 16
0
 public string GetFooterTextForCount(GenericCollectionViewModel <ProfilesAndGroups, GroupHeader> caller, int count)
 {
     if (count <= 0)
     {
         return(CommonResources.NoCommunites);
     }
     return(UIStringFormatterHelper.FormatNumberOfSomething(count, CommonResources.OneCommunityFrm, CommonResources.TwoFourCommunitiesFrm, CommonResources.FiveCommunitiesFrm, true, null, false));
 }
Exemplo n.º 17
0
 public string GetFooterTextForCount(GenericCollectionViewModel2 <NewsFeedData, IVirtualizable> caller, int count)
 {
     if (count == 0)
     {
         return(CommonResources.NoNews);
     }
     return(UIStringFormatterHelper.FormatNumberOfSomething(count, CommonResources.OneNewsFrm, CommonResources.TwoFourNewsFrm, CommonResources.FiveNewsFrm, true, null, false));
 }
 public string GetFooterTextForCount(GenericCollectionViewModel <VKList <ConversationMaterial>, DocumentHeader> caller, int count)
 {
     if (count <= 0)
     {
         return(CommonResources.Documents_NoDocuments);
     }
     return(UIStringFormatterHelper.FormatNumberOfSomething(count, CommonResources.OneDocFrm, CommonResources.TwoFourDocumentsFrm, CommonResources.FiveDocumentsFrm, true, null, false));
 }
Exemplo n.º 19
0
 public string GetFooterTextForCount(GenericCollectionViewModel <VKList <UserOrGroupSource>, SubscriptionItemHeader> caller, int count)
 {
     if (count <= 0)
     {
         return(CommonResources.NoPages);
     }
     return(UIStringFormatterHelper.FormatNumberOfSomething(count, CommonResources.OnePageFrm, CommonResources.TwoFourPagesFrm, CommonResources.FivePagesFrm, true, null, false));
 }
Exemplo n.º 20
0
 private static string GetNewsFooterText(int count)
 {
     if (count <= 0)
     {
         return(CommonResources.NoRecentNews);
     }
     return(UIStringFormatterHelper.FormatNumberOfSomething(count, CommonResources.OneRecentNewsFrm, CommonResources.TwoRecentNewsFrm, CommonResources.FiveRecentNewsFrm, true, null, false));
 }
Exemplo n.º 21
0
 public string GetFooterTextForCount(GenericCollectionViewModel <VKList <VideoAlbum>, AlbumHeader> caller, int count)
 {
     if (count <= 0)
     {
         return(CommonResources.VideoCatalog_NoAlbums);
     }
     return(UIStringFormatterHelper.FormatNumberOfSomething(count, VideoResources.OneAlbumFrm, VideoResources.TwoFourAlbumsFrm, VideoResources.FiveAlbumsFrm, true, null, false));
 }
 public string GetFooterTextForCountFriends(int count)
 {
     if (count <= 0)
     {
         return(CommonResources.NoFriends);
     }
     return(UIStringFormatterHelper.FormatNumberOfSomething(count, CommonResources.OneFriendFrm, CommonResources.TwoFourFriendsFrm, CommonResources.FiveFriendsFrm, true, null, false));
 }
Exemplo n.º 23
0
 public string GetFooterTextForCount(GenericCollectionViewModel <VKList <VKClient.Common.Backend.DataObjects.Video>, VideoHeader> caller, int count)
 {
     if (count <= 0)
     {
         return(CommonResources.NoVideos);
     }
     return(UIStringFormatterHelper.FormatNumberOfSomething(count, CommonResources.OneVideoFrm, CommonResources.TwoFourVideosFrm, CommonResources.FiveVideosFrm, true, null, false));
 }
 private static string GetListsCountStr(int count)
 {
     if (count <= 0)
     {
         return(CommonResources.NoFriendsLists);
     }
     return(UIStringFormatterHelper.FormatNumberOfSomething(count, CommonResources.OneFriendListFrm, CommonResources.TwoFourFriendsListsFrm, CommonResources.FiveFriendsListsFrm, true, null, false));
 }
Exemplo n.º 25
0
 public string GetFooterTextForCount(GenericCollectionViewModel <VKList <Link>, Link> caller, int count)
 {
     if (count <= 0)
     {
         return(CommonResources.NoLinks);
     }
     return(UIStringFormatterHelper.FormatNumberOfSomething(count, CommonResources.OneLinkFrm, CommonResources.TwoFourLinksFrm, CommonResources.FiveLinksFrm, true, null, false));
 }
Exemplo n.º 26
0
 public string GetFooterTextForCount(GenericCollectionViewModel <List <User>, UserGroupHeader> caller, int count)
 {
     if (count <= 0)
     {
         return(CommonResources.NoFollowers);
     }
     return(UIStringFormatterHelper.FormatNumberOfSomething(count, CommonResources.OneFollowerFrm, CommonResources.TwoFourFollowersFrm, CommonResources.FiveFollowersFrm, true, null, false));
 }
Exemplo n.º 27
0
 public string GetFooterTextForCount(GenericCollectionViewModel <UsersListWithCount, FriendHeader> caller, int count)
 {
     if (count <= 0)
     {
         return(CommonResources.NoVotersYet);
     }
     return(UIStringFormatterHelper.FormatNumberOfSomething(count, CommonResources.OnePersonFrm, CommonResources.TwoFourPersonsFrm, CommonResources.FivePersonsFrm, true, null, false));
 }
Exemplo n.º 28
0
 public string GetFooterTextForCount(GenericCollectionViewModel <CommunityInvitationsList, CommunityInvitation> caller, int count)
 {
     if (count > 0)
     {
         return(UIStringFormatterHelper.FormatNumberOfSomething(count, CommonResources.Communities_InvitationOneFrm, CommonResources.Communities_InvitationTwoFrm, CommonResources.Communities_InvitationFiveFrm, true, null, false));
     }
     return(GroupResources.NoInvitations);
 }
 public string GetFooterTextForCount(int count)
 {
     if (count <= 0)
     {
         return(AudioResources.NoTracks);
     }
     return(UIStringFormatterHelper.FormatNumberOfSomething(count, AudioResources.OneTrackFrm, AudioResources.TwoFourTracksFrm, AudioResources.FiveTracksFrm, true, null, false));
 }
Exemplo n.º 30
0
 public string GetFooterTextForCount(int count)
 {
     if (count == 0)
     {
         return(CommonResources.NoCommunites);
     }
     return(UIStringFormatterHelper.FormatNumberOfSomething(count, CommonResources.OneCommunityFrm, CommonResources.TwoFourCommunitiesFrm, CommonResources.FiveCommunitiesFrm, true, null, false));
 }