예제 #1
0
        static void Main(string[] args)
        {
            ProxyImage proxy = new ProxyImage("/etc/img.png");

            proxy.Display();
            proxy.Display();
        }
예제 #2
0
        public void Main()
        {
            IImage image = new ProxyImage("test_img_01.jpg");

            // 图像将从磁盘加载
            image.Display();
            // 图像不需要从磁盘加载  缓存了
            image.Display();
        }
예제 #3
0
        public void Start()
        {
            var image = new ProxyImage(@"V:\Client\WPF\BuildProj\BuildProj\Resources\Images\AV.png");

            // Image will be loaded from disk.
            image.Display();
            // Image will not be loaded from disk.
            image.Display();
        }
예제 #4
0
        static void Main(string[] args)
        {
            Image image = new ProxyImage("test_10mb.jpg");

            //image will be loaded from disk
            image.Display();
            Console.WriteLine();

            //image will not be loaded from disk
            image.Display();
        }
예제 #5
0
        public void WhenProxyImageWillReturnProxyResult()
        {
            var image = new ProxyImage("Picture.jpg");

            Assert.AreEqual("Displaying Picture.jpg", image.Display());
        }