Beispiel #1
0
        protected override IHelloWorld CreateInstance(IContext context)
        {
            HelloWorldSingleton result = HelloWorldSingleton.Instance();

            result.Keyword = "本实例由 HelloWorldProvider 创建!";

            return(result);
        }
        /// <summary>
        /// 外部获取单例的代码.
        /// </summary>
        /// <returns></returns>
        public static HelloWorldSingleton Instance()
        {
            if (me == null)
            {
                me = new HelloWorldSingleton();
            }

            return me;
        }
        /// <summary>
        /// 外部获取单例的代码.
        /// </summary>
        /// <returns></returns>
        public static HelloWorldSingleton Instance()
        {
            if (me == null)
            {
                me = new HelloWorldSingleton();
            }

            return(me);
        }