示例#1
0
 /// <summary>
 /// Event handler for finishing requesting changes.
 /// </summary>
 void OnFinishedRequestChanges()
 {
     if (!m_IsRequestingChanges)
     {
         return;
     }
     m_IsRequestingChanges = false;
     BusyStatusUpdated?.Invoke(false);
 }
示例#2
0
 /// <summary>
 /// Event handler for starting to request changes.
 /// </summary>
 void OnStartedRequestingChanges()
 {
     if (m_IsRequestingChanges)
     {
         return;
     }
     m_IsRequestingChanges = true;
     BusyStatusUpdated?.Invoke(true);
 }
示例#3
0
 /// <summary>
 /// Remove a finished request.
 /// </summary>
 /// <param name="requestId">Id of the request to remove.</param>
 void RemoveRequest(string requestId)
 {
     Assert.IsTrue(m_Requests.Contains(requestId), $"Expects request to have first been made for it to have been finished: {requestId}");
     m_Requests.Remove(requestId);
     // Signal no background activity if no requests in progress
     if (m_Requests.Count == 0)
     {
         BusyStatusUpdated?.Invoke(false);
     }
 }
示例#4
0
 /// <summary>
 /// Add a started request.
 /// </summary>
 /// <param name="requestId">Id of the request to add.</param>
 /// <returns>False if the request already exists.</returns>
 bool AddRequest(string requestId)
 {
     if (m_Requests.Contains(requestId))
     {
         return(false);
     }
     m_Requests.Add(requestId);
     // Signal background activity if this is the only thing running.
     if (m_Requests.Count == 1)
     {
         BusyStatusUpdated?.Invoke(true);
     }
     return(true);
 }