示例#1
0
        private void ShowMoreInvites()
        {
            TimesClickShowMore++;

            Invites.Clear();

            var itemIndex = TimesClickShowMore * 3;

            if (itemIndex >= mInvitesStatic.Count)
            {
                foreach (var item in mInvitesStatic)
                {
                    Invites.Add(item);
                }

                IsShowMoreButton = false;
            }
            else
            {
                for (int i = 0; i < itemIndex; i++)
                {
                    Invites.Add(mInvitesStatic[i]);
                }
                IsShowMoreButton = true;
            }
        }
 /// <summary>
 /// Clears all lists, sets the current list and user to null
 /// </summary>
 public void Reset()
 {
     Lists.Clear();
     Items.Clear();
     Invites.Clear();
     CurrentList = null;
     User        = null;
 }
示例#3
0
        /// <summary>
        /// Loads the invites from Windows Azure Mobile Service invites table
        /// </summary>
        private async void LoadInvitesAsync()
        {
            IEnumerable <Invite> invites = await invitesTable.Where(i => i.ToUserId == User.UserId).ToEnumerableAsync();

            Invites.Clear();
            Invites.AddRange(invites);

            IsPendingInvitesButtonVisible = ViewInvitesCommand.IsEnabled = Invites.Count > 0;
        }
        /// <summary>
        /// Loads the invites from Mobile Services invites table
        /// </summary>
        private async void LoadInvites()
        {
            IEnumerable <Invite> invites = await _invitesTable
                                           .Where(i => i.ToUserId == User.UserId)
                                           .ToEnumerableAsync();

            Invites.Clear();
            Invites.AddRange(invites);

            ViewInvitesCommand.IsEnabled = Invites.Count > 0;
        }
示例#5
0
        public void LoadProject(Project project)
        {
            if (project.Owner.CompanyName == null || project.Owner.CompanyName == string.Empty)
            {
                OwnerName = project.Owner.Name;
                OwnerType = string.Empty;
                Owner     = OwnerName;
            }
            else
            {
                OwnerName = project.Owner.CompanyName;
                OwnerType = "Company";
                Owner     = OwnerType + " " + OwnerName;
            }

            mInvitesStatic.Clear();
            Invites.Clear();
            TimesClickShowMore = 0;

            this.ProjectName = project.Title;
            this.Description = project.Description;
            this.CanEdit     = mCacheService.ProjectHeadingItem.ProjectHeading.UserIsCreator;



            foreach (var item in project.Invites)
            {
                mInvitesStatic.Add(item);
            }

            if (mInvitesStatic.Count > 3)
            {
                for (int i = 0; i < 3; i++)
                {
                    Invites.Add(mInvitesStatic[i]);
                }
                IsShowMoreButton = true;
            }
            else
            {
                foreach (var item in mInvitesStatic)
                {
                    Invites.Add(item);
                }
                IsShowMoreButton = false;
            }
        }
示例#6
0
        public async void InitData()
        {
            if (mCacheService.ProjectHeadingItem != null)
            {
                var projectId = mCacheService.ProjectHeadingItem.ProjectHeading.ProjectId;
                mPlatformService.ShowNetworkIndicator();
                mProgressDialogService.ShowProgressDialog();

                var response = await mApiService.ViewProject(projectId);



                mInvitesStatic.Clear();
                Invites.Clear();
                TimesClickShowMore = 0;

                if (response.StatusCode == System.Net.HttpStatusCode.OK)
                {
                    Project = response.Data;
                    if (Project.UserId == mCacheService.CurrentUserData.UserId)
                    {
                        IsShowInvitee = true;
                        View.ShowInvitee();
                    }
                    else
                    {
                        IsShowInvitee = false;
                        View.HidenInvitee();
                    }
                    LoadProject(Project);
                    IsLoading = false;
                }
                else
                {
                    IsShowMoreButton = false;
                }
                mPlatformService.HideNetworkIndicator();
                mProgressDialogService.HideProgressDialog();
            }
        }