Exemplo n.º 1
0
        private IQueueStore GetStore()
        {
            if (_accessors.Configuration.TestMode)
            {
                return(new InMemoryQueueStore());
            }

#if !SILVERLIGHT
            if (!String.IsNullOrEmpty(_accessors.Configuration.QueuePath))
            {
                try {
                    var store = new FolderQueueStore(_accessors.Configuration.QueuePath, _accessors);
                    if (store.VerifyStoreIsUsable())
                    {
                        return(store);
                    }
                } catch (Exception ex) {
                    _accessors.Log.FormattedError(typeof(QueueManager), "Error trying to create folder store: {0}", ex.Message);
                }
            }
#endif

            try {
                var store = new IsolatedStorageQueueStore(_accessors.Configuration.StoreId, _accessors);
                if (store.VerifyStoreIsUsable())
                {
                    return(store);
                }
            } catch (Exception ex) {
                _accessors.Log.FormattedError(typeof(QueueManager), "Error trying to create isolated storage store: {0}", ex.Message);
            }

            _accessors.Log.Info("Using in memory store provider.", "QueueManger");
            return(new InMemoryQueueStore());
        }
Exemplo n.º 2
0
 public void IsolatedStorageQueueStore() {
     var store = new IsolatedStorageQueueStore("dir", _accessor);
     ValidateStore(store);
 }
Exemplo n.º 3
0
        private IQueueStore GetStore() {
            if (_accessors.Configuration.TestMode)
                return new InMemoryQueueStore();

#if !SILVERLIGHT
            if (!String.IsNullOrEmpty(_accessors.Configuration.QueuePath)) {
                try {
                    var store = new FolderQueueStore(_accessors.Configuration.QueuePath, _accessors);
                    if (store.VerifyStoreIsUsable())
                        return store;
                } catch (Exception ex) {
                    _accessors.Log.FormattedError(typeof(QueueManager), "Error trying to create folder store: {0}", ex.Message);
                }
            }
#endif

            try {
                var store = new IsolatedStorageQueueStore(_accessors.Configuration.StoreId, _accessors);
                if (store.VerifyStoreIsUsable())
                    return store;
            } catch (Exception ex) {
                _accessors.Log.FormattedError(typeof(QueueManager), "Error trying to create isolated storage store: {0}", ex.Message);
            }

            _accessors.Log.Info("Using in memory store provider.", "QueueManger");
            return new InMemoryQueueStore();
        }