public static void InvokeSend(HttpInfo info, HttpWebRequest request) { if (info == null || request == null) { return; } if (OnSend != null) { OnSend(info, request); } }
public static void Register(HttpInfo info, HttpWebRequest request) { if (info == null || request == null) { return; } if (!Requests.ContainsKey(info)) { Requests.Add(info, new List<HttpWebRequest>()); } Requests[info].Add(request); }
public static void Register(HttpInfo info, HttpWebRequest request) { if (info == null || request == null) { return; } Requests.AddOrReplace( info, list => { list = list ?? new List<HttpWebRequest>(); list.AddOrReplace(request); return list; }); }
public static bool Unregister(HttpInfo info, HttpWebRequest request) { bool retVal = false; if (Requests.ContainsKey(info)) { retVal = Requests[info].Remove(request); if (Requests[info].Count == 0) { Requests.Remove(info); } } return retVal; }
public static bool Unregister(HttpInfo info, HttpWebRequest request) { bool retVal = false; var list = Requests.GetValue(info); if (list != null) { retVal = list.Remove(request); list.Free(false); if (list.Count == 0) { Requests.Remove(info); } } return retVal; }
public static void InvokeReceive(HttpInfo info, HttpWebRequest request, HttpWebResponse response) { if (info == null || request == null || response == null) { return; } if (OnReceive != null) { OnReceive(info, request, response); } }