Partager via


SafeDispatcher Class

 

Provides services for managing the queue of work items for a UI or non-UI thread for custom Unified Service Desk hosted controls. For internal use only.

Namespace:   Microsoft.Crm.UnifiedServiceDesk.Dynamics.Utilities
Assembly:  Microsoft.Crm.UnifiedServiceDesk.Dynamics (in Microsoft.Crm.UnifiedServiceDesk.Dynamics.dll)

Inheritance Hierarchy

System.Object
  Microsoft.Crm.UnifiedServiceDesk.Dynamics.Utilities.SafeDispatcher

Syntax

public class SafeDispatcher : IDisposable
Public Class SafeDispatcher
    Implements IDisposable

Constructors

Name Description
System_CAPS_pubmethod SafeDispatcher(String)

Methods

Name Description
System_CAPS_pubmethod BeginInvoke(Action, Boolean)

System_CAPS_pubmethod BeginInvoke(Delegate, DispatcherPriority, Object[], Boolean)

System_CAPS_pubmethod BeginInvoke(Delegate, Object[], Boolean)

System_CAPS_pubmethod BeginInvoke(DispatcherPriority, Delegate, Boolean)

System_CAPS_pubmethod BeginInvoke(DispatcherPriority, Delegate, Object, Boolean)

System_CAPS_pubmethod BeginInvoke(DispatcherPriority, Delegate, Object, Object[], Boolean)

System_CAPS_pubmethod Dispose()

System_CAPS_pubmethod Equals(Object)

(Inherited from Object.)

System_CAPS_protmethod Finalize()

(Inherited from Object.)

System_CAPS_pubmethod GetHashCode()

(Inherited from Object.)

System_CAPS_pubmethod GetType()

(Inherited from Object.)

System_CAPS_pubmethod Invoke(Action, Boolean, Boolean)

System_CAPS_pubmethod Invoke(Action, DispatcherPriority, Boolean, Boolean)

System_CAPS_pubmethod Invoke(Action, DispatcherPriority, CancellationToken, Boolean, Boolean)

System_CAPS_pubmethod Invoke(Action, DispatcherPriority, CancellationToken, TimeSpan, Boolean, Boolean)

System_CAPS_pubmethod Invoke(Delegate, DispatcherPriority, Object[], Boolean, Boolean)

System_CAPS_pubmethod Invoke(Delegate, Object[], Boolean, Boolean)

System_CAPS_pubmethod Invoke(Delegate, TimeSpan, DispatcherPriority, Object[], Boolean, Boolean)

System_CAPS_pubmethod Invoke(Delegate, TimeSpan, Object[], Boolean, Boolean)

System_CAPS_pubmethod Invoke(DispatcherPriority, Delegate, Boolean, Boolean)

System_CAPS_pubmethod Invoke(DispatcherPriority, Delegate, Object, Boolean, Boolean)

System_CAPS_pubmethod Invoke(DispatcherPriority, Delegate, Object, Object[], Boolean, Boolean)

System_CAPS_pubmethod Invoke(DispatcherPriority, TimeSpan, Delegate, Boolean, Boolean)

System_CAPS_pubmethod Invoke(DispatcherPriority, TimeSpan, Delegate, Object, Boolean, Boolean)

System_CAPS_pubmethod Invoke(DispatcherPriority, TimeSpan, Delegate, Object, Object[], Boolean, Boolean)

System_CAPS_pubmethod Invoke<TResult>(Func<TResult>, Boolean, Boolean)

System_CAPS_pubmethod Invoke<TResult>(Func<TResult>, DispatcherPriority, Boolean, Boolean)

System_CAPS_pubmethod Invoke<TResult>(Func<TResult>, DispatcherPriority, CancellationToken, Boolean, Boolean)

System_CAPS_pubmethod Invoke<TResult>(Func<TResult>, DispatcherPriority, CancellationToken, TimeSpan, Boolean, Boolean)

System_CAPS_pubmethod InvokeAsync(Action, Boolean)

System_CAPS_pubmethod InvokeAsync(Action, DispatcherPriority, Boolean)

System_CAPS_pubmethod InvokeAsync(Action, DispatcherPriority, CancellationToken, Boolean)

System_CAPS_pubmethod InvokeAsync<TResult>(Func<TResult>, Boolean)

System_CAPS_pubmethod InvokeAsync<TResult>(Func<TResult>, DispatcherPriority, Boolean)

System_CAPS_pubmethod InvokeAsync<TResult>(Func<TResult>, DispatcherPriority, CancellationToken, Boolean)

System_CAPS_protmethod MemberwiseClone()

(Inherited from Object.)

System_CAPS_pubmethod ToString()

(Inherited from Object.)

Events

Name Description
System_CAPS_pubevent SafeDispatcherUnhandledException

Occurs when a thread exception is thrown and not caught during execution of a delegate by way of Invoke, BeginInvoke, or InvokeAsync.

Remarks

The SafeDispatcher class is a wrapper on the WPF Dispatcher class, and exposes a safe variant for the Invoke, BeginInvoke, and InvokeAsync methods of the Dispatcher class. These methods internally handle any exceptions raised by the delegates called by the methods, and can notify user about the error for handling.

Do not use the SafeDispatcher class directly in your code. It is exposed as a protected property on the DynamicsBaseHostedControl Class, and you should use this property on your custom hosted control instance that is derived from the DynamicsBaseHostedControl Class.

Thread Safety

Any public static ( Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

See Also

Microsoft.Crm.UnifiedServiceDesk.Dynamics.Utilities Namespace
Use SafeDispatcher for custom hosted controls in Unified Service Desk

Return to top

Unified Service Desk 2.0

© 2017 Microsoft. All rights reserved. Copyright