Esempio n. 1
0
        static void Main()
        {
            var repository = WebPageRepository.GetWebPageRepository();

            var downloader = new Downloader();

            while (!repository.IsEmpty)
            {
                var url = repository.Remove();
                downloader.Download(url, GenerateFileNameFromUrl(url));
            }
        }
        public static WebPageRepository GetWebPageRepository()
        {
            if (instance == null)
            {
                lock (syncLock)
                {
                    if (instance == null)
                    {
                        instance = new WebPageRepository();
                    }
                }
            }

            return instance;
        }
Esempio n. 3
0
        public static WebPageRepository GetWebPageRepository()
        {
            if (instance == null)
            {
                lock (syncLock)
                {
                    if (instance == null)
                    {
                        instance = new WebPageRepository();
                    }
                }
            }

            return(instance);
        }