static void Main(string[] args) { ProxyImage proxy = new ProxyImage("/etc/img.png"); proxy.Display(); proxy.Display(); }
public void Main() { IImage image = new ProxyImage("test_img_01.jpg"); // 图像将从磁盘加载 image.Display(); // 图像不需要从磁盘加载 缓存了 image.Display(); }
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(); }
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(); }
public void WhenProxyImageWillReturnProxyResult() { var image = new ProxyImage("Picture.jpg"); Assert.AreEqual("Displaying Picture.jpg", image.Display()); }