Exemplo n.º 1
0
        private void onFriendInvitationNotificationDismissed(NotificationCompleteEnum dismissAction, DNotification data)
        {
            TrayNotificationManager obj = trayNotificationManager;

            obj.NotificationDismissed = (Action <NotificationCompleteEnum, DNotification>)Delegate.Remove(obj.NotificationDismissed, new Action <NotificationCompleteEnum, DNotification>(onFriendInvitationNotificationDismissed));
            switch (dismissAction)
            {
            case NotificationCompleteEnum.acceptButton:
                if (FriendsDataModelService.FriendsList.Count < FriendsDataModelService.MaxFriendsCount)
                {
                    IncomingFriendInvitationData incomingFriendInvitationData2 = (IncomingFriendInvitationData)data.DataPayload;
                    Service.Get <INetworkServicesManager>().FriendsService.AcceptFriendInvitation(incomingFriendInvitationData2.Invitation, Service.Get <SessionManager>().LocalUser);
                }
                else
                {
                    Service.Get <PromptManager>().ShowPrompt("MaximumFriendsPrompt", null);
                }
                break;

            case NotificationCompleteEnum.declineButton:
            {
                IncomingFriendInvitationData incomingFriendInvitationData = (IncomingFriendInvitationData)data.DataPayload;
                Service.Get <INetworkServicesManager>().FriendsService.RejectFriendInvitation(incomingFriendInvitationData.Invitation, Service.Get <SessionManager>().LocalUser);
                break;
            }
            }
        }
Exemplo n.º 2
0
        public void DeclineButtonClicked()
        {
            setButtonsActive(isActive: false);
            IncomingFriendInvitationData component = Service.Get <CPDataEntityCollection>().GetComponent <IncomingFriendInvitationData>(handle);

            Service.Get <INetworkServicesManager>().FriendsService.RejectFriendInvitation(component.Invitation, Service.Get <SessionManager>().LocalUser);
        }
Exemplo n.º 3
0
        public void DeclineFriendInvitationButtonClicked()
        {
            IncomingFriendInvitationData component = Service.Get <CPDataEntityCollection>().GetComponent <IncomingFriendInvitationData>(handle);

            Service.Get <INetworkServicesManager>().FriendsService.RejectFriendInvitation(component.Invitation, Service.Get <SessionManager>().LocalUser);
            deactivateAllElements();
            goToNoneState();
        }
Exemplo n.º 4
0
 private DataEntityHandle addIncomingInvitation(DataEntityHandle handle, IIncomingFriendInvitation invitation)
 {
     if (!handle.IsNull)
     {
         IncomingFriendInvitationData incomingFriendInvitationData = dataEntityCollection.AddComponent <IncomingFriendInvitationData>(handle);
         incomingFriendInvitationData.Init(invitation);
         incomingFriendInvitationData.OnAccepted += onIncomingFriendInvitationAccepted;
         incomingFriendInvitationData.OnRejected += onIncomingFriendInvitationRejected;
     }
     return(handle);
 }
Exemplo n.º 5
0
        private void onIncomingFriendInvitationComponentInitialized(IncomingFriendInvitationData incomingFriendInvitationData)
        {
            incomingFriendInvitationData.OnInitialized -= onIncomingFriendInvitationComponentInitialized;
            DNotification dNotification = createNotification(true, "Friends.FriendsService.wantsfriend", incomingFriendInvitationData.Invitation.Inviter.DisplayName.Text);

            dNotification.DataPayload = incomingFriendInvitationData;
            TrayNotificationManager obj = trayNotificationManager;

            obj.NotificationDismissed = (Action <NotificationCompleteEnum, DNotification>)Delegate.Combine(obj.NotificationDismissed, new Action <NotificationCompleteEnum, DNotification>(onFriendInvitationNotificationDismissed));
            trayNotificationManager.ShowNotification(dNotification);
        }
Exemplo n.º 6
0
 public void AcceptButtonClicked()
 {
     if (FriendsDataModelService.FriendsList.Count < FriendsDataModelService.MaxFriendsCount)
     {
         setButtonsActive(isActive: false);
         IncomingFriendInvitationData component = Service.Get <CPDataEntityCollection>().GetComponent <IncomingFriendInvitationData>(handle);
         Service.Get <INetworkServicesManager>().FriendsService.AcceptFriendInvitation(component.Invitation, Service.Get <SessionManager>().LocalUser);
     }
     else
     {
         Service.Get <PromptManager>().ShowPrompt("MaximumFriendsPrompt", null);
     }
 }