Пример #1
0
 public virtual Task <bool> InitAsync()
 {
     if (_storage == null)
     {
         _storage = new MatchStorage <TMatch, TId>(MatchesSettingsFile);
     }
     return(Task.FromResult(NetworkConnectionTracker.IsNetworkConnected));
 }
Пример #2
0
 public virtual bool Init()
 {
     if (_storage == null)
     {
         _storage = new MatchStorage <TMatch, TId>(MatchesSettingsFile);
     }
     if (!NetworkConnectionTracker.IsNetworkConnected)
     {
         return(false);
     }
     return(true);
 }
Пример #3
0
        public virtual bool Init()
        {
            if (_storage == null)
            {
                _storage = new MatchStorage <TMatch, TId>(MatchesSettingsFile);
            }
            if (!_inited)
            {
                // Use own thread to avoid delay during startup
                IThreadPool threadPool = ServiceRegistration.Get <IThreadPool>(false);
                if (threadPool != null)
                {
                    threadPool.Add(ResumeDownloads, "ResumeDownloads", QueuePriority.Normal, ThreadPriority.BelowNormal);
                }
                _inited = true;
            }

            if (!NetworkConnectionTracker.IsNetworkConnected)
            {
                return(false);
            }
            return(true);
        }