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; } } }
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); }
public void DeclineFriendInvitationButtonClicked() { IncomingFriendInvitationData component = Service.Get <CPDataEntityCollection>().GetComponent <IncomingFriendInvitationData>(handle); Service.Get <INetworkServicesManager>().FriendsService.RejectFriendInvitation(component.Invitation, Service.Get <SessionManager>().LocalUser); deactivateAllElements(); goToNoneState(); }
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); }
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); }
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); } }