Navigation :
Introduction
FAQ
Setup, deployment & projects
Getting started
Examples
Catel.Core
Catel.MVVM
Catel.Fody
Catel.ReSharper
Tips & tricks
API reference
-
Catel.Cores
--
Catel
---
Catel.Android
---
Catel.ApiCop
---
Catel.Caching
---
Catel.Collections
---
Catel.ComponentModel
---
Catel.Configuration
---
Catel.Core
---
Catel.Data
---
Catel.ExceptionHandling
---
Catel.IO
---
Catel.IoC
---
Catel.Linq
---
Catel.Logging
---
Catel.Messaging
---
Catel.Pooling
---
Catel.Reflection
---
Catel.Runtime
---
Catel.Scoping
---
Catel.Services
---
Catel.Test
---
Catel.Text
---
Catel.Threading
---- AsyncLock
---- AsyncWaitQueueExtensions
---- AwaitableDisposable
---- DefaultAsyncWaitQueue
---- IAsyncWaitQueue
---- ReaderWriterLockSlimExtensions
---- SynchronizationContext
---- SynchronizationContextExtensions
---- TaskExtensions
---- TaskHelper
---- TaskShim
---- Timeout
---- Timer
---- TimerCallback
--- Argument
--- AsyncEventHandler
--- AsyncEventHandlerExtensions
--- ByteArrayExtensions
--- CatelEnvironment
--- CompositeFilter
--- CompositePredicate
--- CoreModule
--- DesignTimeCodeAttribute
--- DesignTimeHelper
--- DesignTimeInitializer
--- Disposable
--- DisposableToken
--- Enum
--- EnvironmentHelper
--- EventHandlerExtensions
--- ExceptionExtensions
--- ExceptionFactory
--- ExpressionHelper
--- FastDateTime
--- HashHelper
--- IBindableEnum
--- ICommandManagerExtensions
--- ICompositeFilter
--- IDisposableToken
--- IExecute
--- IExecuteWithObject
--- IFluent
--- INotifyPropertyChangedExtensions
--- IUniqueIdentifyable
--- IWeakAction
--- IWeakEventListener
--- IWeakFunc
--- IWeakReference
--- JsonExtensions
--- KnownPlatforms
--- LanguageHelper
--- MVVMModule
--- MustBeImplementedException
--- NotSupportedInPlatformException
--- ObjectHelper
--- ObjectToStringHelper
--- OpenInstanceActionHandler
--- OpenInstanceEventHandler
--- ParallelHelper
--- Platforms
--- ProcessExtensions
--- ProgressContext
--- ResourceHelper
--- SerializationJsonModule
--- StringExtensions
--- StringToObjectHelper
--- SupportedPlatforms
--- TagHelper
--- ThemeHelper
--- ThreadHelper
--- UniqueIdentifierHelper
--- UriExtensions
--- WeakAction
--- WeakActionBase
--- WeakEventListener
--- WeakFunc
--
Systems
-
Catel.MVVMs
-
Catel.Serialization.Jsons
AwaitableDisposable
Name
Value
Assembly
Catel.Core
Namespace
Catel.Threading
Available on
.NET Framework 4.5, .NET Framework 4.6, Portable Class Libraries, Xamarin - Android, Xamarin - iOS
public struct AwaitableDisposable<T> : ValueType where T : IDisposable
Base types
ValueType
An awaitable wrapper around a task whose result is disposable. The wrapper is not disposable, so this prevents usage errors like “using (MyAsync())” when the appropriate usage should be “using (await MyAsync())”.
Type Parameters
T
The type of the result of the underlying task.
This code originally comes from AsyncEx: https://github.com/StephenCleary/AsyncEx
Fields
Constructors
AwaitableDisposable(Task<T> task)
Initializes a new awaitable wrapper around the specified task.
Parameters
Name
Description
task
The underlying task to wrap.
Methods
AsTask()
Returns the underlying task.
ConfigureAwait(bool continueOnCapturedContext)
Infrastructure. Returns a configured task awaiter for the underlying task.
Parameters
Name
Description
continueOnCapturedContext
Whether to attempt to marshal the continuation back to the captured context.
GetAwaiter()
Infrastructure. Returns the task awaiter for the underlying task.
Have a question about Catel? Use StackOverflow with the Catel tag!
Discussion
Please enable JavaScript to view the comments powered by Disqus.