예제 #1
0
        public static void FetchInitialData()
        {
            if (Me.Data == null)
            {
                Me.FetchData(true);
            }
            if (FAQ.Data == null)
            {
                FAQ.FetchData(true);
            }
            if (Plan.Data == null)
            {
                Plan.FetchData(true);
            }
            if (Evaluation.Data == null)
            {
                Evaluation.FetchData(true);
            }

            if (Status.Data == null)
            {
                GlobalStatus.OnStatusUpdate -= FetchAssignmentAfterStatus;
                GlobalStatus.OnStatusUpdate += FetchAssignmentAfterStatus;
                GlobalStatus.ForceUpdate();
            }
            else if (Assignment.Data == null)
            {
                GlobalStatus.OnStatusUpdate -= FetchAssignmentAfterStatus;
                Assignment.FetchData(true);
            }
        }
        private void RefreshContent()
        {
            if (DataManager.Assignment.Data == null)
            {
                mOngoing.Initialize(new DataBaseObject[0], null);
                mSubmitted.Initialize(new DataBaseObject[0], null);
                return;
            }

            GlobalStatus.SetSeenAssignments();

            List <DataAssignment> ongoingAssignments   = new List <DataAssignment>();
            List <DataAssignment> submittedAssignments = new List <DataAssignment>();

            for (int i = 0; i < DataManager.Assignment.Data.Length; i++)
            {
                if (DataManager.Assignment.Data[i].IsSubmitted)
                {
                    submittedAssignments.Add(DataManager.Assignment.Data[i]);
                }
                else
                {
                    ongoingAssignments.Add(DataManager.Assignment.Data[i]);
                }
            }

            ongoingAssignments.Sort((a, b) => a.EndAt.Value.CompareTo(b.EndAt.Value));

            mOngoing.Initialize(ongoingAssignments.ToArray(), InspectOngoing);
            mSubmitted.Initialize(submittedAssignments.ToArray(), InspectSubmitted);
        }
예제 #3
0
 void Update()
 {
     if (mCurrentContact != null && GlobalStatus.HasMessages(mCurrentContact.ID))
     {
         GlobalStatus.SetSeenMessages(mCurrentContact.ID);
         ChatManager.FetchChat(mCurrentContact.ID);
     }
 }
 private void CheckStatus()
 {
     if (GlobalStatus.HasNewAssignment)
     {
         GlobalStatus.SetSeenAssignments();
         DataManager.Assignment.FetchData(true);
     }
 }
예제 #5
0
 private void UpdateState()
 {
     if (mContact == null)
     {
         mImage.enabled = GlobalStatus.HasNewMessage;
     }
     else
     {
         mImage.enabled = GlobalStatus.HasMessages(mContact.ID);
     }
 }
예제 #6
0
        public void ChatWith(DataUser contact)
        {
            mCurrentContact = contact;
            GlobalStatus.SetSeenMessages(mCurrentContact.ID);
            ChatManager.FetchChat(mCurrentContact.ID);

            mContactPage.Close();
            mChatPage.Open(mCurrentContact);

            mChatPage.Refresh();

            UIHeader.Show(mHeaderTag, BackToContacts);
        }