Esempio n. 1
0
        /// <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();
            }
        }
Esempio n. 2
0
        /// <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);
            }
        }
Esempio n. 3
0
 /// <summary>
 /// Removes this monitor from the collection.
 /// </summary>
 /// <param name="monitor"></param>
 internal void Remove(IQueryMonitorEx monitor)
 {
     Items.Remove(monitor);
 }
Esempio n. 4
0
 /// <summary>
 /// Adds this monitor to the collection.
 /// </summary>
 /// <param name="monitor"></param>
 internal void Add(IQueryMonitorEx monitor)
 {
     Items.Add(monitor);
 }