Exemplo n.º 1
0
        public void Init(IProfileData profileData)
        {
            this._profileData = profileData;
            this._groupData   = this._profileData as GroupData;
            this._isGroup     = this._groupData != null;
            List <MediaListItemViewModelBase> items = ProfilePhotosViewModel.CreateItems(profileData);

            if (!ProfilePhotosViewModel.AreItemsEqual((IList <MediaListItemViewModelBase>)items, (IList <MediaListItemViewModelBase>) this._itemsVM.Collection))
            {
                this._offset = this._isGroup || items.Count <= 0 ? items.Count : ((PhotoMediaListItemViewModel)Enumerable.Last <MediaListItemViewModelBase>(items)).Photo.real_offset + 1;
                this._cachedSources.Clear();
                foreach (PhotoMediaListItemViewModel listItemViewModel in items)
                {
                    this._cachedSources.Add(listItemViewModel.ImageUri);
                }
                this.Items = new ObservableCollection <MediaListItemViewModelBase>(items);
                this._itemsVM.LoadData(true, true, true, true, null, null, false);
            }
            // ISSUE: type reference
            // ISSUE: method reference
            this.NotifyPropertyChanged <int>(() => this.Count);
            // ISSUE: type reference
            // ISSUE: method reference
            this.NotifyPropertyChanged <bool>(() => this.CanDisplay);
            // ISSUE: type reference
            // ISSUE: method reference
            this.NotifyPropertyChanged <string>(() => this.Title);
        }
Exemplo n.º 2
0
 public DataAccessService(IProfileData profileData, IUtilisateurData utilisateurData, IColonneData colonneData, IProfileColonneData profileColonneData)
 {
     ProfileData        = profileData;
     UtilisateurData    = utilisateurData;
     ColonneData        = colonneData;
     ProfileColonneData = profileColonneData;
 }
Exemplo n.º 3
0
        public VKSocialNetworkItem(IProfileData profileData)
            : base("/Resources/Profile/Contacts/ProfileVK.png")
        {
            UserData userData = profileData as UserData;

            if (userData != null)
            {
                User user = userData.user;
                this._domain = string.IsNullOrEmpty(user.domain) ? string.Format("id{0}", (object)user.id) : user.domain;
            }
            else
            {
                GroupData groupData = profileData as GroupData;
                if (groupData != null)
                {
                    Group group = groupData.group;
                    this._domain = string.IsNullOrEmpty(group.screen_name) ? string.Format("club{0}", (object)group.id) : group.screen_name;
                }
            }
            this.Data = (object)this._domain;
            if (string.IsNullOrEmpty(this._domain))
            {
                return;
            }
            this._webLink         = "vk.com/" + this._domain;
            this.NavigationAction = (Action)(() => Navigator.Current.NavigateToWebUri(this._webLink, true, false));
        }
        public AllProfilePostsToggleViewModel(IProfileData profileData, bool isAllPosts = true)
        {
            this.AllPostsText = CommonResources.Group_AllPosts;

            this._profileData         = profileData;
            this._isAllPosts          = isAllPosts;
            this.PostsCountVisibility = Visibility.Collapsed;
            GroupData groupData = this._profileData as GroupData;

            if (groupData != null)
            {
                if (groupData.group != null && (groupData.group.GroupType == GroupType.PublicPage || !groupData.group.CanSeeAllPosts))
                {
                    this._hidePostsUnderline   = true;
                    this.AllPostsText          = UIStringFormatterHelper.FormatNumberOfSomething(groupData.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, (object)this._profileData.NameGen);
            }
        }
Exemplo n.º 5
0
        public void Init(IProfileData profileData)
        {
            if (this._profileData == null || profileData.MainSectionType != this._profileData.MainSectionType)
            {
                this._canDisplayHorizontalItems = false;
                this._canDisplayVerticalItems   = false;
                if (profileData.MainSectionType == ProfileMainSectionType.None)
                {
                    this._canDisplayHorizontalItems = false;
                    this._canDisplayVerticalItems   = false;
                }
                else
                {
                    switch (profileData.MainSectionType)
                    {
                    case ProfileMainSectionType.Photos:
                        this._mediaHorizontalItemsViewModel = (IMediaHorizontalItemsViewModel) new ProfilePhotosViewModel();
                        this._canDisplayHorizontalItems     = true;
                        break;

                    case ProfileMainSectionType.Discussions:
                        this._mediaVerticalItemsViewModel = (IMediaVerticalItemsViewModel) new ProfileDiscussionsViewModel();
                        break;

                    case ProfileMainSectionType.Audios:
                        this._mediaVerticalItemsViewModel = (IMediaVerticalItemsViewModel) new ProfileAudiosViewModel();
                        break;

                    case ProfileMainSectionType.Videos:
                        this._mediaHorizontalItemsViewModel = (IMediaHorizontalItemsViewModel) new ProfileVideosViewModel();
                        this._canDisplayHorizontalItems     = true;
                        break;

                    case ProfileMainSectionType.Market:
                        this._mediaHorizontalItemsViewModel = (IMediaHorizontalItemsViewModel) new ProfileMarketViewModel();
                        this._canDisplayHorizontalItems     = true;
                        break;
                    }
                    this._canDisplayVerticalItems = !this._canDisplayHorizontalItems;
                }
            }
            this._profileData = profileData;
            if (this._canDisplayHorizontalItems)
            {
                this.NotifyPropertyChanged <IMediaHorizontalItemsViewModel>((System.Linq.Expressions.Expression <Func <IMediaHorizontalItemsViewModel> >)(() => this.MediaHorizontalItemsViewModel));
                this._mediaHorizontalItemsViewModel.Init(this._profileData);
            }
            else
            {
                this.NotifyPropertyChanged <IMediaVerticalItemsViewModel>((System.Linq.Expressions.Expression <Func <IMediaVerticalItemsViewModel> >)(() => this.MediaVerticalItemsViewModel));
                this._mediaVerticalItemsViewModel.Init(this._profileData);
            }
            this.NotifyPropertyChanged <Visibility>((System.Linq.Expressions.Expression <Func <Visibility> >)(() => this.MediaHorizontalItemsVisibility));
            this.NotifyPropertyChanged <Visibility>((System.Linq.Expressions.Expression <Func <Visibility> >)(() => this.MediaVerticalItemsVisibility));
            this._mediaSectionsViewModel.Init(this._profileData, this._profileData.MainSectionType);
            this.NotifyPropertyChanged <Visibility>((System.Linq.Expressions.Expression <Func <Visibility> >)(() => this.MediaSectionsVisibility));
            this.NotifyPropertyChanged <bool>((System.Linq.Expressions.Expression <Func <bool> >)(() => this.CanDisplay));
        }
Exemplo n.º 6
0
            /// <summary>
            /// Adds the given element to the collection
            /// </summary>
            /// <param name="item">The item to add</param>
            public override void Add(IModelElement item)
            {
                IProfileData profileDatasCasted = item.As <IProfileData>();

                if ((profileDatasCasted != null))
                {
                    this._parent.ProfileDatas.Add(profileDatasCasted);
                }
            }
Exemplo n.º 7
0
        private static List <MediaListItemViewModelBase> CreateItems(IProfileData profileData)
        {
            List <MediaListItemViewModelBase> itemViewModelBaseList = new List <MediaListItemViewModelBase>();

            if (profileData == null || profileData.videos == null)
            {
                return(itemViewModelBaseList);
            }
            itemViewModelBaseList.AddRange((IEnumerable <MediaListItemViewModelBase>)Enumerable.Select <VKClient.Common.Backend.DataObjects.Video, VideoMediaListItemViewModel>(profileData.videos, (Func <VKClient.Common.Backend.DataObjects.Video, VideoMediaListItemViewModel>)(item => new VideoMediaListItemViewModel(item))));
            return(itemViewModelBaseList);
        }
Exemplo n.º 8
0
        private static List <MediaListItemViewModelBase> CreateItems(IProfileData profileData)
        {
            List <MediaListItemViewModelBase> itemViewModelBaseList = new List <MediaListItemViewModelBase>();

            if (profileData == null || profileData.photos == null)
            {
                return(itemViewModelBaseList);
            }
            itemViewModelBaseList.AddRange((IEnumerable <MediaListItemViewModelBase>)profileData.photos.items.Select <Photo, PhotoMediaListItemViewModel>((Func <Photo, PhotoMediaListItemViewModel>)(photo => new PhotoMediaListItemViewModel(photo))));
            return(itemViewModelBaseList);
        }
        private static List <MediaListItemViewModelBase> CreateItems(IProfileData profileData)
        {
            List <MediaListItemViewModelBase> itemViewModelBaseList = new List <MediaListItemViewModelBase>();

            if ((profileData != null ? profileData.goods : null) == null)
            {
                return(itemViewModelBaseList);
            }
            itemViewModelBaseList.AddRange(Enumerable.Select <Product, ProductMediaListItemViewModel>(profileData.goods.items, (Func <Product, ProductMediaListItemViewModel>)(item => new ProductMediaListItemViewModel(item))));
            return(itemViewModelBaseList);
        }
Exemplo n.º 10
0
            /// <summary>
            /// Removes the given item from the collection
            /// </summary>
            /// <returns>True, if the item was removed, otherwise False</returns>
            /// <param name="item">The item that should be removed</param>
            public override bool Remove(IModelElement item)
            {
                IProfileData profileDataItem = item.As <IProfileData>();

                if (((profileDataItem != null) &&
                     this._parent.ProfileDatas.Remove(profileDataItem)))
                {
                    return(true);
                }
                return(false);
            }
Exemplo n.º 11
0
        public void Init(IProfileData profileData)
        {
            this._profileData = profileData;
            this._isGroup     = profileData is GroupData;
            List <MediaListItemViewModelBase> itemViewModelBaseList = new List <MediaListItemViewModelBase>();

            if (this._profileData.audios != null && this._profileData.audios.Count > 0)
            {
                itemViewModelBaseList.AddRange((IEnumerable <MediaListItemViewModelBase>) this._profileData.audios.Select <AudioObj, AudioMediaListItemViewModel>((Func <AudioObj, AudioMediaListItemViewModel>)(audio => new AudioMediaListItemViewModel(audio, this._profileData.audios))));
            }
            this.Items = new List <MediaListItemViewModelBase>((IEnumerable <MediaListItemViewModelBase>)itemViewModelBaseList);
            this.NotifyPropertyChanged <int>((Expression <Func <int> >)(() => this.Count));
        }
Exemplo n.º 12
0
        public void Init(IProfileData profileData)
        {
            this._profileData = profileData;
            this.groupData    = profileData as GroupData;
            List <MediaListItemViewModelBase> itemViewModelBaseList = new List <MediaListItemViewModelBase>();

            if (this._profileData.topics != null && this._profileData.topics.Count > 0)
            {
                itemViewModelBaseList.AddRange((IEnumerable <MediaListItemViewModelBase>) this._profileData.topics.Select <Topic, DiscussionMediaListItemViewModel>((Func <Topic, DiscussionMediaListItemViewModel>)(item => new DiscussionMediaListItemViewModel(item))));
            }
            this.Items = new List <MediaListItemViewModelBase>((IEnumerable <MediaListItemViewModelBase>)itemViewModelBaseList);
            this.NotifyPropertyChanged <int>((Expression <Func <int> >)(() => this.Count));
        }
        public void Init(IProfileData profileData, ProfileMainSectionType mainSectionType)
        {
            this._profileData     = profileData;
            this._isGroup         = this._profileData is Group;
            this._mainSectionType = mainSectionType;
            List <MediaListSectionViewModel> mediaItems = this.CreateMediaItems();

            if (ProfileMediaSectionsViewModel.AreItemsEqual((IList <MediaListSectionViewModel>)mediaItems, (IList <MediaListSectionViewModel>) this._items))
            {
                return;
            }
            this.Items = new List <MediaListSectionViewModel>((IEnumerable <MediaListSectionViewModel>)mediaItems);
        }
Exemplo n.º 14
0
        void UpdateFriendsList(IProfileData friendData)
        {
            for (int i = 0; i < myFriendsList.Count; i++)
            {
                if (friendData.Username == myFriendsList[i].Username)
                {
                    return;
                }
            }

            myFriendsList.Add(friendData);
            AddFriendPlate();
        }
        /// <inheritdoc/>
        public void Update(IProfileData item)
        {
            XElement element = this.Document.Element("ProfilesFile").Element("Profiles").Descendants("Profile").Where(x => x.Element("Name")?.Value == item.Name).Single();

            XElement newelement = new XElement(
                "Profile",
                new XElement("Name", item.Name),
                new XElement("CampaignScores", string.Join("#", item.CampaignScore)),
                new XElement("CompletedRandomLevelCount", item.CompletedRandomLevelCount));

            element.ReplaceWith(newelement);
            this.Document.Save(this.url);
        }
Exemplo n.º 16
0
 public StatusInfoListItem(IProfileData profileData)
 {
     this._profileData = profileData;
     this._isStatusSet = !string.IsNullOrEmpty(this._profileData.Activity);
     this.Text         = this._isStatusSet ? this._profileData.Activity : CommonResources.ChangeStatusText;
     if (this._profileData.AdminLevel > 1)
     {
         this.IsTiltEnabled = true;
         this.TapAction     = (Action)(() =>
         {
             GroupData groupData = this._profileData as GroupData;
             Utility.OpenSetStatusPopup(this._profileData.Activity, groupData == null ? 0L : groupData.Id, new Action <string>(this.UpdateStatus));
         });
     }
     EventAggregator.Current.Subscribe((object)this);
 }
 /// <inheritdoc/>
 public void Insert(IProfileData newItem)
 {
     if (this.GetAll().Where(x => x.Name == newItem.Name).Count() > 0)
     {
         throw new Exception();
     }
     else
     {
         this.Document.Element("ProfilesFile").Element("Profiles").Add(
             new XElement(
                 "Profile",
                 new XElement("Name", newItem.Name),
                 new XElement("CampaignScores"),
                 new XElement("CompletedRandomLevelCount", newItem.CompletedRandomLevelCount)));
         this.Document.Save(this.url);
     }
 }
Exemplo n.º 18
0
 public StatusItem(IProfileData profileData)
     : base(ProfileInfoItemType.RichText)
 {
     this._profileData = profileData;
     this._isStatusSet = !string.IsNullOrEmpty(this._profileData.Activity);
     this.Title        = CommonResources.StatusText;
     this.Data         = this._isStatusSet ? (object)this._profileData.Activity : (object)CommonResources.ChangeStatusText;
     if (this._profileData.AdminLevel > 1)
     {
         this.NavigationAction = (Action)(() =>
         {
             GroupData groupData = this._profileData as GroupData;
             Utility.OpenSetStatusPopup(this._profileData.Activity, groupData == null ? 0L : groupData.Id, new Action <string>(this.UpdateData));
         });
     }
     EventAggregator.Current.Subscribe((object)this);
 }
Exemplo n.º 19
0
        public void Init(IProfileData profileData)
        {
            this._profileData = profileData;
            this._isGroup     = this._profileData is GroupData;
            List <MediaListItemViewModelBase> items = ProfileVideosViewModel.CreateItems(profileData);

            if (!ProfileVideosViewModel.AreItemsEqual((IList <MediaListItemViewModelBase>)items, (IList <MediaListItemViewModelBase>) this._itemsVM.Collection))
            {
                this._offset = items.Count;
                this._cachedSources.Clear();
                foreach (VideoMediaListItemViewModel listItemViewModel in items)
                {
                    this._cachedSources.Add(listItemViewModel.ImageUri);
                }
                this.Items = new ObservableCollection <MediaListItemViewModelBase>(items);
                this._itemsVM.LoadData(true, true, true, true, null, null, false);
            }
            this.NotifyPropertyChanged <int>((System.Linq.Expressions.Expression <Func <int> >)(() => this.Count));
            this.NotifyPropertyChanged <bool>((System.Linq.Expressions.Expression <Func <bool> >)(() => this.CanDisplay));
        }
Exemplo n.º 20
0
        public void Init(IProfileData profileData)
        {
            this._profileData = profileData;
            this._groupData   = this._profileData as GroupData;
            this._isGroup     = this._groupData != null;
            List <MediaListItemViewModelBase> items = ProfilePhotosViewModel.CreateItems(profileData);

            if (!ProfilePhotosViewModel.AreItemsEqual((IList <MediaListItemViewModelBase>)items, (IList <MediaListItemViewModelBase>) this._itemsVM.Collection))
            {
                this._offset = this._isGroup || items.Count <= 0 ? items.Count : ((PhotoMediaListItemViewModel)items.Last <MediaListItemViewModelBase>()).Photo.real_offset + 1;
                this._cachedSources.Clear();
                foreach (PhotoMediaListItemViewModel listItemViewModel in items)
                {
                    this._cachedSources.Add(listItemViewModel.ImageUri);
                }
                this.Items = new ObservableCollection <MediaListItemViewModelBase>(items);
                this._itemsVM.LoadData(true, true, true, true, (Action <List <MediaListItemViewModelBase> >)null, (Action <BackendResult <VKList <Photo>, ResultCode> >)null, false);
            }
            this.NotifyPropertyChanged <int>((System.Linq.Expressions.Expression <Func <int> >)(() => this.Count));
            this.NotifyPropertyChanged <bool>((System.Linq.Expressions.Expression <Func <bool> >)(() => this.CanDisplay));
            this.NotifyPropertyChanged <string>((System.Linq.Expressions.Expression <Func <string> >)(() => this.Title));
        }
Exemplo n.º 21
0
        public void HandlePhotoDeleted(PhotoDeletedFromAlbum message)
        {
            IProfileData profileData = this._profileData;
            long         num         = profileData != null ? profileData.Id : 0L;

            if (num == 0L)
            {
                return;
            }
            if (this._isGroup)
            {
                num *= -1L;
            }
            if (message.OwnerId != num || this.Items == null)
            {
                return;
            }
            using (IEnumerator <MediaListItemViewModelBase> enumerator = this.Items.GetEnumerator())
            {
                while (enumerator.MoveNext())
                {
                    MediaListItemViewModelBase  current           = enumerator.Current;
                    PhotoMediaListItemViewModel listItemViewModel = current as PhotoMediaListItemViewModel;
                    Photo photo = listItemViewModel != null ? listItemViewModel.Photo :  null;
                    if (photo != null && photo.id == message.PhotoId)
                    {
                        this._cachedSources.RemoveAt(this.Items.IndexOf(current));
                        this._profileData.photos.items.Remove(photo);
                        this.Items.Remove(current);
                        --this._profileData.photos.count;
                        // ISSUE: type reference
                        // ISSUE: method reference
                        this.NotifyPropertyChanged <int>(() => this.Count);
                        break;
                    }
                }
            }
        }
Exemplo n.º 22
0
        public void Init(IProfileData profileData)
        {
            this._profileData = profileData;
            this._isGroup     = this._profileData is GroupData;
            List <MediaListItemViewModelBase> items = ProfileMarketViewModel.CreateItems(profileData);

            if (!this._profileData.isMarketMainAlbumEmpty && this._isGroup)
            {
                Group group = ((GroupData)this._profileData).group;
                int?  nullable;
                if (group == null)
                {
                    nullable = new int?();
                }
                else
                {
                    VKClient.Common.Backend.DataObjects.Market market = group.market;
                    nullable = market != null ? new int?(market.main_album_id) : new int?();
                }
                this._marketAlbumId = nullable ?? 0;
            }
            if (!ProfileMarketViewModel.AreItemsEqual((IList <MediaListItemViewModelBase>)items, (IList <MediaListItemViewModelBase>) this._itemsVM.Collection))
            {
                this._offset = items.Count;
                this._cachedSources.Clear();
                foreach (ProductMediaListItemViewModel listItemViewModel in items)
                {
                    this._cachedSources.Add(listItemViewModel.ImageUri);
                }
                this.Items = new ObservableCollection <MediaListItemViewModelBase>(items);
                this._itemsVM.LoadData(true, true, true, true, null, null, false);
            }
            // ISSUE: method reference
            this.NotifyPropertyChanged <int>(() => this.Count);
            // ISSUE: method reference
            this.NotifyPropertyChanged <bool>(() => this.CanDisplay);
        }
Exemplo n.º 23
0
 public ProfileController(IProfileData profileData)
 {
     //_context = context;
     this.profileData = profileData;
 }
Exemplo n.º 24
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ProfileObject"/> class.
 /// </summary>
 /// <param name="data">Datas of profile</param>
 public ProfileObject(IProfileData data)
 {
     this.ProfileDatas = data;
 }
Exemplo n.º 25
0
 public DiscreteExerciseController(IProfileData profileData)
 {
     this.profileData = profileData;
 }
Exemplo n.º 26
0
 public ProfileService(IProfileDataFactory profilerDataFactory)
 {
     _profileData = new ProfileDataFactory().Create();
 }