Пример #1
0
        /// <summary>
        ///     Sets up the ObjectCache with the given settings.
        /// </summary>
        /// <returns>True if the object cache was set with the sepcified settings, false if it is already initialized.</returns>
        public static bool Initialize(ObjectCacheSettings settings)
        {
            lock (settingsLock)
            {
                if (ObjectCache.settings == null)
                {
                    ObjectCache.settings = settings;
                    return(true);
                }
            }

            return(false);
        }
Пример #2
0
 /// <summary>
 ///     Initializes the object cache.
 /// </summary>
 /// <remarks>
 ///     Normally, initializing the object cache is handled for you when you create a server or client
 ///     however there are times when it is necessary to initialize it without creating a server or client
 ///     such as during testing. This method can be used to initialize the cache in those circumstances.
 ///
 ///     If the cache is already initialized this method will do nothing.
 /// </remarks>
 /// <param name="settings"></param>
 //DR3 Make static
 public void InitializeObjectCache(ObjectCacheSettings settings)
 {
     ObjectCache.Initialize(settings);
 }