Beispiel #1
0
        public ICancellableAsyncResult BeginExecute(TableOperation operation, TableRequestOptions requestOptions,
                                                    OperationContext operationContext, AsyncCallback callback, object state)
        {
            var result = new TableAsyncResult
            {
                AsyncState             = Execute(operation, requestOptions, operationContext),
                AsyncWaitHandle        = new Mutex(),
                CompletedSynchronously = true,
                IsCompleted            = true
            };

            callback(result);
            return(result);
        }
Beispiel #2
0
        public ICancellableAsyncResult BeginSetPermissions(TablePermissions permissions, TableRequestOptions requestOptions,
                                                           OperationContext operationContext, AsyncCallback callback, object state)
        {
            _permissions = permissions;
            var result = new TableAsyncResult
            {
                AsyncState             = _permissions,
                AsyncWaitHandle        = new Mutex(),
                CompletedSynchronously = true,
                IsCompleted            = true
            };

            callback(result);
            return(result);
        }
Beispiel #3
0
        public ICancellableAsyncResult BeginExecuteQuerySegmented <TElement>(TableQuery <TElement> query, TableContinuationToken token,
                                                                             TableRequestOptions requestOptions,
                                                                             OperationContext operationContext, AsyncCallback callback,
                                                                             object state) where TElement : ITableEntity, new()
        {
            var result = new TableAsyncResult
            {
                AsyncState             = ExecuteQuerySegmented(query, token, requestOptions, operationContext),
                AsyncWaitHandle        = new Mutex(),
                CompletedSynchronously = true,
                IsCompleted            = true
            };

            callback(result);
            return(result);
        }
Beispiel #4
0
        public ICancellableAsyncResult BeginDeleteIfExists(TableRequestOptions requestOptions, OperationContext operationContext,
                                                           AsyncCallback callback, object state)
        {
            var result = new TableAsyncResult
            {
                AsyncState             = _entries != null,
                AsyncWaitHandle        = new Mutex(),
                CompletedSynchronously = true,
                IsCompleted            = true
            };

            if (_entries != null)
            {
                _entries.Clear();
                _entries = null;
            }

            return(result);
        }
Beispiel #5
0
        public ICancellableAsyncResult BeginCreateIfNotExists(TableRequestOptions requestOptions, OperationContext operationContext,
                                                              AsyncCallback callback, object state)
        {
            var result = new TableAsyncResult
            {
                AsyncState             = _entries == null,
                AsyncWaitHandle        = new Mutex(),
                CompletedSynchronously = true,
                IsCompleted            = true
            };

            if (_entries == null)
            {
                _entries = new List <DynamicTableEntity>();
            }

            callback(result);
            return(result);
        }