public class Singleton<T> where T : class, new() { public static T Value { get { return Instance.Value; } } private static class Instance { public static readonly T Value = new T(); } }
posted on 2013-11-14 13:06 JRoger 阅读(157) 评论(0) 收藏 举报
博客园 © 2004-2025 浙公网安备 33010602011771号 浙ICP备2021040463号-3