public override void PopulateMemberInfo(CalendarEventInviteInfo invite)
        {
            this.m_memberInfo    = invite;
            this.m_nameText.text = invite.name;
            ChrClassesRec recordFirstOrDefault = StaticDB.chrClassesDB.GetRecordFirstOrDefault((ChrClassesRec rec) => rec.Name.Equals(invite.className, StringComparison.OrdinalIgnoreCase));

            if (recordFirstOrDefault != null)
            {
                this.m_classIcon.sprite = GeneralHelpers.LoadClassIcon(new uint?((uint)recordFirstOrDefault.ID));
            }
            if (invite.inviteIsMine)
            {
                this.m_classIconRing.sprite = this.m_goldRingSprite;
            }
            if (invite.modStatus == "CREATOR")
            {
                this.m_ownerIcon.gameObject.SetActive(true);
            }
            else if (invite.modStatus == "MODERATOR")
            {
                this.m_moderatorIcon.gameObject.SetActive(true);
            }
            this.m_checkMark.gameObject.SetActive(CalendarStatusExtensions.IsAttending(invite.inviteStatus));
            this.m_questionMark.gameObject.SetActive(invite.inviteStatus == 8u);
            this.m_xMark.gameObject.SetActive(invite.inviteStatus == 2u);
        }
 private void UpdateNumAttendees()
 {
     if (!CalendarStatusExtensions.IsAttending(new uint?(this.EventData.InviteStatus)))
     {
         return;
     }
     base.StartCoroutine(this.UpdateNumAttendeesCoroutine());
 }
        private void SetNumAttendees(uint numAttendees)
        {
            this.m_numAttendees = new uint?(numAttendees);
            TextCycler textCycler = (!(this.m_subtext != null)) ? null : this.m_subtext.GetComponent <TextCycler>();

            if (textCycler != null && CalendarStatusExtensions.IsAttending(new uint?(this.EventData.InviteStatus)) && this.m_numAttendees.Value > 1u)
            {
                textCycler.ClearStrings();
                TextCycler textCycler2   = textCycler;
                string     @string       = StaticDB.GetString("YOU_PLUS_PEOPLE_ARE_GOING", "You +{0} are going. [PH]");
                uint?      numAttendees2 = this.m_numAttendees;
                textCycler2.AddString(string.Format(@string, (numAttendees2 == null) ? null : new uint?(numAttendees2.GetValueOrDefault() - 1u)));
                Community community = CommunityData.Instance.GetCommunity(this.EventData.ClubID);
                if (community != null)
                {
                    textCycler.AddString(community.Name);
                }
            }
        }
 public bool IsPendingInvite()
 {
     return(CalendarStatusExtensions.IsInvited(new uint?(this.InviteStatus)) && this.StartTime >= DateAndTime.GetServerTimeLocal() && (this.CalendarType == CalendarType.Player || this.CalendarType == CalendarType.GuildSignup || this.CalendarType == CalendarType.CommunitySignup));
 }
        public void OnOpenEvent(Calendar.CalendarOpenEventEvent eventArgs)
        {
            Calendar.OnCalendarOpenEvent           -= new Calendar.CalendarOpenEventHandler(this.OnOpenEvent);
            base.GetComponent <CanvasGroup>().alpha = 1f;
            foreach (Selectable selectable in base.GetComponentsInChildren <Selectable>())
            {
                selectable.interactable = true;
            }
            CalendarEventInfo calendarEventInfo;

            if (!Calendar.GetEventInfo(ref calendarEventInfo))
            {
                this.CloseDialog();
                return;
            }
            this.m_eventTitle.text       = calendarEventInfo.title;
            this.m_eventDescription.text = calendarEventInfo.description;
            this.m_eventDateTime.text    = calendarEventInfo.time.ToDateTime().ToString(StaticDB.GetString("EVENT_DATE_AND_TIME", "M/d/yy h:mm tt"));
            if (this.CalendarEventItem.EventData.IsCommunityEvent)
            {
                Community community = CommunityData.Instance.GetCommunity(this.CalendarEventItem.EventData.ClubID);
                this.m_communityName.text = ((community == null) ? string.Empty : community.Name);
            }
            else
            {
                this.m_communityName.text = string.Empty;
            }
            foreach (Button button in base.GetComponentsInChildren <Button>())
            {
                button.interactable = true;
            }
            bool flag = calendarEventInfo.time.ToDateTime() >= DateAndTime.GetServerTimeLocal();

            this.m_addInviteButton.interactable = flag;
            this.m_addInviteButton.gameObject.SetActive(this.CalendarEventItem.EventData.ModStatus == "CREATOR" || this.CalendarEventItem.EventData.ModStatus == "MODERATOR");
            if (!flag || calendarEventInfo.isLocked)
            {
                this.m_acceptButton.interactable    = false;
                this.m_tentativeButton.interactable = false;
                this.m_declineButton.interactable   = false;
            }
            else if (this.CalendarEventItem.EventData.IsCommunityEvent)
            {
                if (this.CalendarEventItem.EventData.ModStatus == "CREATOR")
                {
                    this.m_acceptButton.interactable    = false;
                    this.m_tentativeButton.interactable = false;
                    this.m_declineButton.interactable   = false;
                }
                else
                {
                    bool flag2 = (CommunityData.Instance.GetCommunity(this.CalendarEventItem.EventData.ClubID) == null) ? (calendarEventInfo.inviteStatus == 1u) : (calendarEventInfo.inviteStatus == 6u || calendarEventInfo.inviteStatus == 8u);
                    bool flag3 = (CommunityData.Instance.GetCommunity(this.CalendarEventItem.EventData.ClubID) == null) ? (calendarEventInfo.inviteStatus == 8u) : (calendarEventInfo.inviteStatus == 6u || calendarEventInfo.inviteStatus == 8u);
                    bool flag4 = (CommunityData.Instance.GetCommunity(this.CalendarEventItem.EventData.ClubID) == null) ? (calendarEventInfo.inviteStatus == 2u) : (calendarEventInfo.inviteStatus == 7u);
                    this.m_acceptButton.interactable    = !flag2;
                    this.m_tentativeButton.interactable = !flag3;
                    this.m_declineButton.interactable   = !flag4;
                }
            }
            else if (!CalendarStatusExtensions.CanRSVP(calendarEventInfo.inviteStatus))
            {
                this.m_acceptButton.interactable    = false;
                this.m_tentativeButton.interactable = false;
                this.m_declineButton.interactable   = false;
            }
            else
            {
                this.m_acceptButton.interactable    = (calendarEventInfo.inviteStatus != 1u);
                this.m_tentativeButton.interactable = (calendarEventInfo.inviteStatus != 8u);
                this.m_declineButton.interactable   = (calendarEventInfo.inviteStatus != 2u);
            }
            if (this.CalendarEventItem.EventData.IsCommunityEvent && CommunityData.Instance.GetCommunity(this.CalendarEventItem.EventData.ClubID) != null)
            {
                this.m_acceptButton.GetComponentInChildren <Text>().text  = StaticDB.GetString("EVENT_SIGN_UP", "SIGN UP [PH]");
                this.m_declineButton.GetComponentInChildren <Text>().text = StaticDB.GetString("EVENT_REMOVE_SIGN_UP", "REMOVE SIGN UP [PH]");
            }
            this.UpdateInvitesList();
        }
 public void SetEventInfo(CalendarEventData eventData)
 {
     this.EventData   = eventData;
     this.m_date.text = this.GetDateString(eventData.EventTime);
     if (this.m_time != null)
     {
         this.m_time.text = eventData.EventTime.ToString(StaticDB.GetString("SHORT_TIME", "h:mm tt"));
     }
     this.m_eventName.text = eventData.Title;
     if (this.m_subtext != null)
     {
         TextCycler component = this.m_subtext.GetComponent <TextCycler>();
         Community  community = CommunityData.Instance.GetCommunity(this.EventData.ClubID);
         if (this.EventData.CalendarType == CalendarType.CommunityAnnouncement)
         {
             if (community != null)
             {
                 component.AddString(community.Name);
             }
         }
         else if (CalendarStatusExtensions.IsAttending(new uint?(this.EventData.InviteStatus)))
         {
             component.AddString(StaticDB.GetString("YOU_ARE_GOING", "You are going [PH]"));
             if (community != null)
             {
                 component.AddString(community.Name);
             }
             this.UpdateNumAttendees();
         }
         else if (this.EventData.InviteStatus == 8u)
         {
             component.AddString(StaticDB.GetString("TENTATIVE", "Tentative [PH]"));
             if (community != null)
             {
                 component.AddString(community.Name);
             }
         }
         else if (CalendarStatusExtensions.IsInvited(new uint?(this.EventData.InviteStatus)))
         {
             if (!string.IsNullOrEmpty(this.EventData.InvitedBy))
             {
                 component.AddString(string.Format(StaticDB.GetString("INVITED_BY", "Invited by {0} [PH]"), this.EventData.InvitedBy));
             }
             else
             {
                 component.AddString(StaticDB.GetString("REPLY_TO_EVENT", "Reply to this event [PH]"));
             }
             if (community != null)
             {
                 component.AddString(community.Name);
             }
         }
         else if (this.EventData.InviteStatus == 2u)
         {
             component.AddString(StaticDB.GetString("DECLINED", "You are not going [PH]"));
         }
         else
         {
             this.m_subtext.gameObject.SetActive(false);
         }
     }
     if (this.m_inviteStatus != null)
     {
         if (CalendarStatusExtensions.IsAttending(new uint?(this.EventData.InviteStatus)))
         {
             this.m_inviteStatus.sprite = this.m_checkMark;
         }
         else if (this.EventData.InviteStatus == 8u)
         {
             this.m_inviteStatus.sprite = this.m_questionMark;
         }
         else if (CalendarStatusExtensions.IsInvited(new uint?(this.EventData.InviteStatus)))
         {
             this.m_inviteStatus.sprite = this.m_exclamationMark;
         }
         else if (this.EventData.InviteStatus == 2u)
         {
             this.m_inviteStatus.sprite = this.m_xMark;
         }
         else
         {
             this.m_inviteStatus.gameObject.SetActive(false);
         }
     }
 }
        private void OnOpenEvent(Calendar.CalendarOpenEventEvent eventArgs)
        {
            Calendar.OnCalendarOpenEvent -= new Calendar.CalendarOpenEventHandler(this.OnOpenEvent);
            List <CalendarEventInviteInfo> list = new List <CalendarEventInviteInfo>();

            for (uint num = 0u; num < Calendar.GetNumInvites(); num += 1u)
            {
                CalendarEventInviteInfo item;
                if (Calendar.EventGetInvite(num, ref item))
                {
                    list.Add(item);
                }
            }
            this.SetNumAttendees((uint)list.Count((CalendarEventInviteInfo invite) => CalendarStatusExtensions.IsAttending(invite.inviteStatus)));
            Calendar.CloseEvent();
        }