Example #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;
            }
        }
Example #2
0
 public void Invite(int invitor, int invitee) => OnlyWithLeader(invitor, ldr =>
 {
     var toInvite = CenterServer.Instance.FindCharacter(invitee);
     if (toInvite == null)
     {
         ldr.SendPacket(PartyPacket.PartyError(PartyFunction.UNABLE_TO_FIND_PLAYER));
     }
     else if (Invites.ContainsKey(toInvite.ID))
     {
         ldr.SendPacket(PartyPacket.PartyErrorWithName(PartyFunction.INVITE_USER_ALREADY_HAS_INVITE, toInvite.Name));
     }
     else if (toInvite.PartyID != 0)
     {
         ldr.SendPacket(PartyPacket.PartyError(PartyFunction.JOIN_ALREADY_JOINED));
     }
     else if (IsFull())
     {
         ldr.SendPacket(PartyPacket.PartyError(PartyFunction.JOIN_ALREADY_FULL));
     }
     else
     {
         _log.Debug($"Sending invite from party {partyId} from character {invitor} to {invitee}");
         toInvite.SendPacket(PartyPacket.PartyInvite(this));
         Invites.Add(toInvite.ID, this);
         //TODO do invites expire?
     }
 });
        private void Invite()
        {
            if (EmailInvite != string.Empty && EmailInvite != null)
            {
                Validators.EmailValidator validator = new Validators.EmailValidator();

                var result = validator.Validate(EmailInvite);

                if (result.IsValid)
                {
                    CancelAllSearch();
                    Invite item = new ShopIt.Core.Models.Invite();
                    item.InviteeEmail = EmailInvite;
                    Invites.Add(new InviteCreateProjectItemViewModel(this, item));
                    Mvx.Resolve <ITrackingService>().SendEvent("Invite a user on create project");
                    RaisePropertyChanged("Invites");
                    EmailInvite           = string.Empty;
                    IsShowButtonTapInvite = false;
                }
                else if (result.Errors != null)
                {
                    var firstError = result.Errors.First();
                    mMessageboxService.ShowToast(firstError.ErrorMessage);
                }
            }
            else
            {
                View.HidenKeyboard();
            }
        }
Example #4
0
        private async void LoadInvites()
        {
            var invites = await DiscordService.GuildService.GetGuildInvites(_guild.Model.Id);

            foreach (var invite in invites)
            {
                Invites.Add(new BindableInvite(invite));
            }
        }
Example #5
0
        public virtual Invite Invite(Member member)
        {
            var invite = new Invite(Id, member.Id)
            {
                Guild  = this,
                Member = member
            };

            Invites.Add(invite);
            return(invite);
        }
Example #6
0
 private void OnWoWPartyInvite(object sender, WoWEventHandler.OnRequestArgs args)
 {
     Application.Current.Dispatcher.BeginInvoke(DispatcherPriority.Normal, (Action)(() =>
     {
         var logItem = "[" + DateTime.Now.ToShortTimeString() + "] [" + args.Player + "] Party invite";
         Invites.Add(logItem);
         if (!LogInvites)
         {
             return;
         }
         logItem.Log(LogFiles.InviteLog);
     }));
 }
Example #7
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;
            }
        }
 private void SelectSuggestedContact(Invite contact)
 {
     CancelAllSearch();
     Invites.Add(new InviteCreateProjectItemViewModel(this, contact));
     EmailInvite = string.Empty;
 }