public static void InvokeProxy() { IImage image = new ProxyImage("imagemTeste.jpg"); image.display(); Console.WriteLine(""); image.display(); Console.ReadLine(); }
private void btProxyPattern_Click(object sender, EventArgs e) { string str = ""; IImage image = new ProxyImage("test_10mb.jpg"); //图像将从磁盘加载 str += image.display() + "\r\n"; //图像将无法从磁盘加载 str += image.display() + "\r\n"; tbOutWindow.Text = str; }
static void Main() { Image image = new ProxyImage("fileName.png"); image.display(); }