コード例 #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);
        }