Exemplo n.º 1
0
        public void Save()
        {
            this.Check();

            lock (_lockObject)
            {
#if DEBUG
                var stopwatch = new Stopwatch();
                stopwatch.Start();
#endif

                {
                    var tasks = new List <Task>();

                    tasks.Add(Task.Run(() => _downloadManager.Save()));

                    Task.WaitAll(tasks.ToArray());
                }

                {
                    var tasks = new List <Task>();

                    tasks.Add(Task.Run(() => _networkManager.Save()));
                    tasks.Add(Task.Run(() => _cacheManager.Save()));

                    Task.WaitAll(tasks.ToArray());
                }

#if DEBUG
                stopwatch.Stop();
                Debug.WriteLine("CoreManager Save: {0}", stopwatch.ElapsedMilliseconds);
#endif
            }
        }