📄 spooler.cs
字号:
using System;
namespace singleSpooler
{
/// <summary>
/// Prototype of Spooler Singleton
/// such that only one instane can ever exist.
/// </summary>
public class Spooler {
static bool instance_flag = false; //true if one instance
public Spooler() {
if (instance_flag)
throw new SingletonException("Only one printer allowed");
else
instance_flag=true; //set flag for one instance
Console.WriteLine ("printer opened");
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -