设计模式のSingleton Pattern(单例模式)----创建模式

单例模式没有什么好讲的,我们 举个例子

        #region 单例定义
        /// <summary>
        /// 类单例
        /// </summary>
        private static WindowController instance = null;
        #endregion
        internal static WindowController GetInstance()
        {
            if (instance == null)
            {
                instance = new WindowController();
            }

            return instance;
        }
原文地址:https://www.cnblogs.com/xietianjiao/p/8118862.html