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); }
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); } }
private void UpdateState() { if (mContact == null) { mImage.enabled = GlobalStatus.HasNewMessage; } else { mImage.enabled = GlobalStatus.HasMessages(mContact.ID); } }
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); }