/// <summary>
        /// 创建CastleFactory对象
        /// </summary>
        /// <returns></returns>
        public static CastleFactory Create()
        {
            if (singleton == null)
            {
                lock (hashtable.SyncRoot)
                {
                    if (singleton == null)
                    {
                        singleton = new CastleFactory();
                    }
                }
            }

            return(singleton);
        }
Beispiel #2
0
        /// <summary>
        /// Creates this instance.
        /// </summary>
        /// <returns></returns>
        public static CastleFactory Create()
        {
            lock (hashtable.SyncRoot)
            {
                if (singleton == null)
                {
                    var config = CastleFactoryConfiguration.GetConfig();

                    if (config == null)
                    {
                        throw new WarningException("Not find configuration section castleFactory!");
                    }

                    singleton = new CastleFactory(config);
                }
            }

            return(singleton);
        }