Beispiel #1
0
 protected virtual bool CheckAndLogResult <Trequest, Tevent>(string p_logText, EResult p_result, bool p_bIOFailure, string p_eventName, ref System.Action <Tevent> p_event)
 {
     lock (m_lock)
     {
         m_pendingRequests.RemoveInactive <Trequest>();
         if (IsDebugLogEnabled)
         {
             Debug.Log(p_logText + ": (fail:" + p_bIOFailure + ") " + p_result + " requests left: " + m_pendingRequests.Count <Trequest>());
         }
     }
     if (p_result == EResult.k_EResultOK && !p_bIOFailure)
     {
         return(true);
     }
     else
     {
         ErrorEventArgs errorArgs = ErrorEventArgs.Create(p_result);
         HandleError(p_logText + ": failed! ", errorArgs);
         if (p_eventName != null && p_event != null)
         {
             CallSingleShotEventHandlers(p_eventName, (Tevent)System.Activator.CreateInstance(typeof(Tevent), errorArgs), ref p_event);                     // call single shot event with error
         }
         return(false);
     }
 }