How to implement singleton design pattern in C#?
Can anyone help me?

有帮助吗?

解决方案

In singleton pattern, a class can only have one instance and provides access point to it globally.

public sealed class Singleton
{
     private static readonly Singleton _instance = new Singleton();
}
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top