经典著作。关于设计模式。全名Introduction to Design Patterns in C# Code.zip。探讨C#中的模式问题。

源代码在线查看: singlespooler.cs

软件大小: 2482 K
上传用户: yingyingyingyin
关键词: Introduction Patterns Design Code
下载地址: 免注册下载 普通下载 VIP

相关代码

				using System;
				
				namespace singleSpooler
				{
					/// 
					/// Summary description for Class1.
					/// 
					public class singleSpooler 	{
						static void Main(string[] args) { 
							Spooler pr1, pr2;
				      //open one printer--this should always work
				      Console.WriteLine ("Opening one spooler");
				      try {
						pr1 = new Spooler();
				      }
				      catch (SingletonException e)	{
						  Console.WriteLine (e.Message);
					  }
				      //try to open another printer --should fail
				      Console.WriteLine ("Opening two spoolers");
				      try{
					      pr2 = new Spooler();
				      }
				      catch (SingletonException e) {
						  Console.WriteLine (e.Message);
					  }
				}
					}
				}
							

相关资源