예제 #1
0
파일: Program.cs 프로젝트: sgww/cozy
        private static void OnColor()
        {
            IUrlGeneraterRunner p1 = new MultiUrlGeneraterRunner();
            IUrl2UrlRunner      p2 = new BlockedUrl2UrlRunner();
            IUrl2ResultRunner   p3 = new AsyncUrl2ResultRunner();

            var result = new List <UserColor>();

            p1.From(new UserColorUrlGenerater(1, 132));
            p1.To(p2);
            p2.To(p3);
            p2.SetProcessor(new UserColorUrl2Url(4));
            p3.To(new UserColorResult(result));

            p3.Start();
            p2.Start();
            p1.Start();

            Console.ReadKey();
            using (var fs = new FileStream("Color.json", FileMode.Create, FileAccess.ReadWrite))
            {
                using (var writer = new StreamWriter(fs))
                {
                    writer.Write(JsonConvert.SerializeObject(result));
                }
            }
        }
예제 #2
0
        static void Main(string[] args)
        {
            IUrlGeneraterRunner p1 = new MultiUrlGeneraterRunner();
            IUrl2UrlRunner      p2 = new BlockedUrl2UrlRunner();
            IUrl2UrlRunner      p3 = new BlockedUrl2UrlRunner();
            IUrl2UrlRunner      p4 = new BlockedUrl2UrlRunner();

            var urls = new FixedUrls();

            urls.Urls.Add("https://tarheelants.com/collections");
            p1.From(urls);

            p2.SetProcessor(new Main2Collects(4));
            p1.To(p2);

            p3.SetProcessor(new Collect2Items(4));
            p2.To(p3);

            p4.SetProcessor(new Item2Image(4));
            p3.To(p4);

            var downloader = new XJpgDownloader();

            downloader.SetSavePath(@"F:\ant\tarheelants\");
            p4.To(downloader);


            p4.Start();
            p3.Start();
            p2.Start();
            p1.Start();
            Console.ReadKey();
        }
예제 #3
0
파일: Program.cs 프로젝트: sgww/cozy
        static void Main(string[] args)
        {
            IUrlGeneraterRunner p1 = new MultiUrlGeneraterRunner();
            IUrl2ResultRunner   p3 = new AsyncUrl2ResultRunner();

            IUrlGenerater gen1 = new TestUrlGenerater();
            IUrlGenerater gen2 = new TestUrlGenerater2();

            p1.From(gen1);
            p1.From(gen2);
            p1.To(p3);
            p3.To(new TestUrl2Result());

            p3.Start();
            p1.Start();
        }
예제 #4
0
        static void Main(string[] args)
        {
            IUrlGeneraterRunner p1 = new MultiUrlGeneraterRunner();
            IUrl2UrlRunner      p2 = new BlockedUrl2UrlRunner();
            IUrl2ResultRunner   p3 = new AsyncUrl2ResultRunner();

            p1.From(new TestUrlGenerater());
            p1.To(p2);
            p2.To(p3);
            p2.SetProcessor(new TestUrl2Url());
            p3.To(new TestUrl2Result());

            p3.Start();
            p2.Start();
            p1.Start();
        }