Beispiel #1
0
        /// <summary>
        /// Constructor.
        /// </summary>
        /// <param name="method"></param>
        internal QueryMonitor(APIMethods method)
        {
            m_lastUpdate      = DateTime.MinValue;
            m_isFullKeyNeeded = method.HasAttribute <FullKeyAttribute>();
            m_methodHeader    = method.GetHeader();
            m_forceUpdate     = true;
            m_method          = method;
            m_enabled         = true;

            NetworkMonitor.Register(this);
        }
Beispiel #2
0
        /// <summary>
        /// Constructor.
        /// </summary>
        /// <param name="method"></param>
        internal QueryMonitor(APIMethods method)
        {
            m_lastUpdate      = DateTime.MinValue;
            m_isFullKeyNeeded = method.HasAttribute <FullKeyAttribute>();
            m_methodHeader    = (method.HasHeader() ? method.GetHeader() : String.Empty);
            m_forceUpdate     = true;
            m_method          = method;
            m_enabled         = true;

            bool methodHasAttribute = m_method.HasAttribute <UpdateAttribute>();

            m_cacheStyle = (methodHasAttribute ? m_method.GetAttribute <UpdateAttribute>().CacheStyle : CacheStyle.Short);

            NetworkMonitor.Register(this);
        }
Beispiel #3
0
        /// <summary>
        /// Constructor.
        /// </summary>
        /// <param name="method">The method.</param>
        /// <param name="callback">The callback.</param>
        /// <exception cref="System.ArgumentNullException">callback;@The callback cannot be null.</exception>
        internal QueryMonitor(Enum method, Action <EsiResult <T> > callback)
        {
            // Check callback not null
            callback.ThrowIfNull(nameof(callback), "The callback cannot be null.");

            LastUpdate     = DateTime.MinValue;
            m_forceUpdate  = true;
            m_onUpdated    = callback;
            Method         = method;
            Enabled        = false;
            QueryOnStartup = false;

            NetworkMonitor.Register(this);

            EveMonClient.TimerTick += EveMonClient_TimerTick;
        }