Show / Hide Table of Contents

Class StaSynchronizationContext

A synchronization context running in a STA thread.

Inheritance
object
SynchronizationContext
StaSynchronizationContext
Implements
IDisposable
SynchronizationContext.IsWaitNotificationRequired()
SynchronizationContext.OperationCompleted()
SynchronizationContext.OperationStarted()
SynchronizationContext.SetSynchronizationContext(SynchronizationContext)
SynchronizationContext.Wait(nint[], bool, int)
SynchronizationContext.Current
object.Equals(object)
object.Equals(object, object)
object.GetHashCode()
object.GetType()
object.ReferenceEquals(object, object)
object.ToString()
Namespace: Sartorius.SAF.Threading
Assembly: Sartorius.SAF.dll
Syntax
public sealed class StaSynchronizationContext : SynchronizationContext, IDisposable
Remarks

The DispatcherSynchronizationContext makes problems in .NET Core (some issues with loading the DispatcherFrame from WindowsBase).

Methods

View Source

CreateCopy()

When overridden in a derived class, creates a copy of the synchronization context.

Declaration
public override SynchronizationContext CreateCopy()
Returns
Type Description
SynchronizationContext

A new SynchronizationContext object.

Overrides
SynchronizationContext.CreateCopy()
View Source

Dispose()

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

Declaration
public void Dispose()
View Source

Post(SendOrPostCallback, object)

When overridden in a derived class, dispatches an asynchronous message to a synchronization context.

Declaration
public override void Post(SendOrPostCallback d, object state)
Parameters
Type Name Description
SendOrPostCallback d

The SendOrPostCallback delegate to call.

object state

The object passed to the delegate.

Overrides
SynchronizationContext.Post(SendOrPostCallback, object)
View Source

Run()

Starts processing the queue. This method will run until the StaSynchronizationContext is disposed.

Declaration
public void Run()
View Source

Send(SendOrPostCallback, object)

When overridden in a derived class, dispatches a synchronous message to a synchronization context.

Declaration
public override void Send(SendOrPostCallback d, object state)
Parameters
Type Name Description
SendOrPostCallback d

The SendOrPostCallback delegate to call.

object state

The object passed to the delegate.

Overrides
SynchronizationContext.Send(SendOrPostCallback, object)
Exceptions
Type Condition
NotSupportedException

The method was called in a Windows Store app. The implementation of SynchronizationContext for Windows Store apps does not support the Send(SendOrPostCallback, object) method.

View Source

StartNew()

Creates a new STA thread and starts processing the queue.

Declaration
public static StaSynchronizationContext StartNew()
Returns
Type Description
StaSynchronizationContext

Implements

IDisposable

Extension Methods

CollectionExtensions.AddRange<T, TCollection>(TCollection, IEnumerable<T>)
SerializableObjectCloneExtension.Clone<T>(T)
  • View Source
Back to top Generated by DocFX