static void Main(string[] args) { Image image = new ProxyImage("Test.jpg"); Console.WriteLine("Image will be loaded from disk..."); image.Display(); Console.WriteLine("Image is already loaded from the disk..."); image.Display(); }
static void Main(string[] args) { var image = new ProxyImage("demo.png"); image.Display(); image.Display(); Console.ReadKey(); }
static void Main(string[] args) { IImage image = new ProxyImage("test_10mb.jpg"); //Image will be loaded from disk image.Display(); Console.WriteLine(""); //Image cannot be loaded from disk image.Display(); Console.Read(); }
public static void Main(string[] args) { IImage image = new ProxyImage("test_10Mo.jpg"); // Image will be loaded from disk image.Display(); Console.WriteLine("\n"); // Image will not be loaded from disk image.Display(); Console.ReadLine(); }
static void Main(string[] args) { var image = new ProxyImage("test_10mb.jpg"); Console.WriteLine(); // 图像将从磁盘加载 image.Display(); Console.WriteLine(); // 图像不需要从磁盘加载 image.Display(); Console.ReadKey(); }
static void Main(string[] args) { // Initialize == Loading image + displaying IImage image = new ProxyImage("test.jpg"); image.Display(); //Already loaded image.Display(); // New image with initialization == Loading image + displaying. IImage image2 = new ProxyImage("test2.jpg"); image2.Display(); Console.ReadKey(); }
static void Main(string[] args) { IImage image = new ProxyImage() { FileName = "filename.jpg" }; image.Display(); }