/// <summary> /// Requests an update for the given method. /// </summary> /// <param name="method">The method.</param> /// <exception cref="System.ArgumentNullException">method</exception> public void Query(Enum method) { method.ThrowIfNull(nameof(method)); IQueryMonitorEx monitor = this[method] as IQueryMonitorEx; if (monitor != null && monitor.HasAccess) { monitor.ForceUpdate(); } }
/// <summary> /// Resets the last API updates. /// </summary> /// <param name="lastUpdates">The last updates.</param> private void ResetLastAPIUpdates(IEnumerable <SerializableAPIUpdate> lastUpdates) { foreach (SerializableAPIUpdate lastUpdate in lastUpdates) { Enum method = ESIMethods.Methods.FirstOrDefault(apiMethod => apiMethod.ToString() == lastUpdate.Method); if (method == null) { continue; } IQueryMonitorEx monitor = QueryMonitors[method] as IQueryMonitorEx; monitor?.Reset(lastUpdate.Time); } }
/// <summary> /// Removes this monitor from the collection. /// </summary> /// <param name="monitor"></param> internal void Remove(IQueryMonitorEx monitor) { Items.Remove(monitor); }
/// <summary> /// Adds this monitor to the collection. /// </summary> /// <param name="monitor"></param> internal void Add(IQueryMonitorEx monitor) { Items.Add(monitor); }