コード例 #1
0
        /// <summary>
        /// Init constructor.
        /// </summary>
        public DependencyObjectDispatcher(System.Windows.DependencyObject dependencyObject, System.Windows.Threading.DispatcherPriority priority)
        {
            if (dependencyObject == null || dependencyObject.Dispatcher == null)
            {
                throw new ArgumentNullException("dependencyObject");
            }

            _dispatcher = dependencyObject.Dispatcher;
            _priority   = priority;
        }
コード例 #2
0
        /// <summary>
        /// Constructs a DispatcherScheduler that schedules units of work on the given <see cref="System.Windows.Threading.Dispatcher"/> at the given priority.
        /// </summary>
        /// <param name="dispatcher">Dispatcher to schedule work on.</param>
        /// <param name="priority">Priority at which units of work are scheduled.</param>
        /// <exception cref="ArgumentNullException"><paramref name="dispatcher"/> is null.</exception>
        public DispatcherScheduler(System.Windows.Threading.Dispatcher dispatcher, System.Windows.Threading.DispatcherPriority priority)
        {
            if (dispatcher == null)
            {
                throw new ArgumentNullException(nameof(dispatcher));
            }

            _dispatcher = dispatcher;
            _priority   = priority;
        }
コード例 #3
0
 public static void SubmitWorkItem(Action action, System.Windows.Threading.DispatcherPriority priority)
 {
     if (allowNextProcess && !_touchupOccured)
     {
         allowNextProcess = false;
         System.Windows.Application.Current.Dispatcher.BeginInvoke(
             priority,
             action
             ).Completed += dispatcherOperation_Completed;
     }
 }
コード例 #4
0
        /// <summary>
        /// Constructs a DispatcherScheduler that schedules units of work on the given <see cref="System.Windows.Threading.Dispatcher"/>.
        /// </summary>
        /// <param name="dispatcher">Dispatcher to schedule work on.</param>
        /// <exception cref="ArgumentNullException"><paramref name="dispatcher"/> is null.</exception>
        public DispatcherScheduler(System.Windows.Threading.Dispatcher dispatcher)
        {
            if (dispatcher == null)
            {
                throw new ArgumentNullException(nameof(dispatcher));
            }

            _dispatcher = dispatcher;
#if HAS_DISPATCHER_PRIORITY
            _priority = Windows.Threading.DispatcherPriority.Normal;
#endif
        }
コード例 #5
0
 public static void Focus(UIElement element, System.Windows.Threading.DispatcherPriority priority, Func <bool> shouldSetFocus)
 {
     Debug.Assert(element != null);
     element.Dispatcher.BeginInvoke(priority, (Action)(() =>
     {
         if (shouldSetFocus())
         {
             element.Focus();
             if (element.Focusable)
             {
                 Keyboard.Focus(element);
             }
         }
     }));
 }
コード例 #6
0
 public void Redraw(ISegment segment, System.Windows.Threading.DispatcherPriority priority)
 {
     this.adapter.TextEditor.TextArea.TextView.Redraw(segment, priority);
 }
コード例 #7
0
 public static void Focus(UIElement element, System.Windows.Threading.DispatcherPriority priority)
 {
     Focus(element, priority, () => true);
 }
コード例 #8
0
 /// <summary>
 /// Creates new dispatcher based on given System.Windows dispatcher object.
 /// </summary>
 public static IEventDispatcher Create(System.Windows.Threading.Dispatcher dispatcher, System.Windows.Threading.DispatcherPriority priority)
 {
     return(new DependencyObjectDispatcher(dispatcher, priority));
 }
コード例 #9
0
 public void DispatchOnUIThread(Action action, System.Windows.Threading.DispatcherPriority priority) => _inner.DispatchOnUIThread(action, priority);
コード例 #10
0
ファイル: AvalonWrappers.cs プロジェクト: dotnet/wpf-test
 /// <summary/>
 public void BeginInvokeShutdown(System.Windows.Threading.DispatcherPriority priority)
 {
     new System.Security.PermissionSet(System.Security.Permissions.PermissionState.Unrestricted).Assert();
     InnerObject.BeginInvokeShutdown(priority);
 }
コード例 #11
0
 public static void Invoke(this System.Windows.Threading.Dispatcher dispatcher, System.Action action, System.Windows.Threading.DispatcherPriority priority)
 {
 }
コード例 #12
0
 public static System.Windows.Threading.DispatcherOperation BeginInvoke(this System.Windows.Threading.Dispatcher dispatcher, System.Action action, System.Windows.Threading.DispatcherPriority priority)
 {
     throw null;
 }