• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# DispatcherPriority类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中DispatcherPriority的典型用法代码示例。如果您正苦于以下问题:C# DispatcherPriority类的具体用法?C# DispatcherPriority怎么用?C# DispatcherPriority使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



DispatcherPriority类属于命名空间,在下文中一共展示了DispatcherPriority类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: PostAction

 public static void PostAction(
     this DispatcherObject obj,
     Action action,
     DispatcherPriority priority = DispatcherPriority.Input)
 {
     obj.Dispatcher.BeginInvoke(priority, action);
 }
开发者ID:modulexcite,项目名称:NZag,代码行数:7,代码来源:DispatcherObjectExtensions.cs


示例2: InvokeIfRequired

 public static void InvokeIfRequired(this Dispatcher disp, Action dotIt, DispatcherPriority priority)
 {
     if (disp.Thread != Thread.CurrentThread)
         disp.Invoke(priority, dotIt);
     else
         dotIt();
 }
开发者ID:andrewpros,项目名称:AuroraAssetEditor,代码行数:7,代码来源:WpfControlThreadingExtensions.cs


示例3: InvokeIfRequired

 public static void InvokeIfRequired(this Dispatcher dispatcher, Action action, DispatcherPriority priority)
 {
     if (!dispatcher.CheckAccess())
     dispatcher.Invoke(priority, (Delegate) action);
       else
     action();
 }
开发者ID:unbearab1e,项目名称:FlattyTweet,代码行数:7,代码来源:DispatcherExtensions.cs


示例4: LightClawSynchronizationContext

        public LightClawSynchronizationContext(Dispatcher dispatcher, DispatcherPriority priority)
        {
            Contract.Requires<ArgumentNullException>(dispatcher != null);

            this.dispatcher = dispatcher;
            this.priority = priority;
        }
开发者ID:ScianGames,项目名称:Engine,代码行数:7,代码来源:LightClawSynchronizationContext.cs


示例5: DispatcherTimer

 /// <summary>
 /// Initializes a new instance of the <see cref="DispatcherTimer"/> class.
 /// </summary>
 /// <param name="interval">The interval at which to tick.</param>
 /// <param name="priority">The priority to use.</param>
 /// <param name="dispatcher">The dispatcher to use.</param>
 /// <param name="callback">The event to call when the timer ticks.</param>
 public DispatcherTimer(TimeSpan interval, DispatcherPriority priority, EventHandler callback, Dispatcher dispatcher)
 {
     this.priority = priority;
     this.Dispatcher = dispatcher;
     this.Interval = interval;
     this.Tick += callback;
 }
开发者ID:Scellow,项目名称:Perspex,代码行数:14,代码来源:DispatcherTimer.cs


示例6: DispatcherThrottle

        /// <summary>
        /// Initializes a new instance of the <see cref="DispatcherThrottle" /> class.
        /// </summary>
        /// <param name="priority">The priority of the dispatcher.</param>
        /// <param name="target">The target action to invoke when the throttle condition is hit.</param>
        public DispatcherThrottle(DispatcherPriority priority, [NotNull] Action target)
        {
            Contract.Requires(target != null);

            _target = target;
            _priority = priority;
        }
开发者ID:tom-englert,项目名称:TomsToolbox,代码行数:12,代码来源:DispatcherThrottle.cs


示例7: DispatcherOperation

 internal DispatcherOperation(Dispatcher dispatcher, Delegate del, DispatcherPriority priority, object[] args)
 {
     myDispatcher = dispatcher;
     myDelegate = del;
     myPriority = priority;
     myArgs = args;
 }
开发者ID:koush,项目名称:Xaml,代码行数:7,代码来源:DispatcherOperation.cs


示例8: DispatcherTimer

        /// <summary>
        ///     Creates a timer that is bound to the specified dispatcher and
        ///     will be processed at the specified priority, after the
        ///     specified timeout.
        /// </summary>
        /// <param name="interval">
        ///     The interval to tick the timer after.
        /// </param>
        /// <param name="priority">
        ///     The priority to process the timer at.
        /// </param>
        /// <param name="callback">
        ///     The callback to call when the timer ticks.
        /// </param>
        /// <param name="dispatcher">
        ///     The dispatcher to use to process the timer.
        /// </param>
        public DispatcherTimer(TimeSpan interval, DispatcherPriority priority, EventHandler callback, Dispatcher dispatcher) // NOTE: should be Priority
        {
            // 






            if(callback == null)
            {
                throw new ArgumentNullException("callback");
            }
            if(dispatcher == null)
            {
                throw new ArgumentNullException("dispatcher");
            }

            if (interval.TotalMilliseconds < 0)
                throw new ArgumentOutOfRangeException("interval", SR.Get(SRID.TimeSpanPeriodOutOfRange_TooSmall));

            if (interval.TotalMilliseconds > Int32.MaxValue)
                throw new ArgumentOutOfRangeException("interval", SR.Get(SRID.TimeSpanPeriodOutOfRange_TooLarge));

            Initialize(dispatcher, priority, interval);
            
            Tick += callback;
            Start();
        }
开发者ID:nlh774,项目名称:DotNetReferenceSource,代码行数:46,代码来源:DispatcherTimer.cs


示例9: Execute

		public void Execute(Delegate method, DispatcherPriority priority)
		{
			if (application == null)
			{
				ExecuteDirectlyOrDuringATest(method);
				return;
			}

			var dispatcher = application.Dispatcher;

			if ((application != null) && isAsync)
			{
				dispatcher.BeginInvoke(method);
				return;
			}

			var notRequireUiThread = dispatcher.CheckAccess();

			if (notRequireUiThread)
			{
				ExecuteDirectlyOrDuringATest(method);
				return;
			}

			if (isAsync)
			{
				dispatcher.BeginInvoke(method, priority);
				return;
			}

			dispatcher.Invoke(method, priority);
		}
开发者ID:matteomigliore,项目名称:HSDK,代码行数:32,代码来源:Execution.cs


示例10: DispatcherTimer

 public DispatcherTimer(Dispatcher dispatcher, ITaskScheduler scheduler, TimeSpan interval, DispatcherPriority priority)
 {
     this.dispatcher = dispatcher;
     this.scheduler = scheduler;
     this.Interval = interval;
     this.Priority = priority;
 }
开发者ID:highzion,项目名称:Granular,代码行数:7,代码来源:DispatcherTimer.cs


示例11: DispatcherTimer

 /// <summary>
 /// Initializes a new instance of the <see cref="DispatcherTimer"/> class.
 /// </summary>
 /// <param name="interval">The interval at which to tick.</param>
 /// <param name="priority">The priority to use.</param>
 /// <param name="dispatcher">The dispatcher to use.</param>
 /// <param name="callback">The event to call when the timer ticks.</param>
 public DispatcherTimer(TimeSpan interval, DispatcherPriority priority, EventHandler callback, Dispatcher dispatcher)
 {
     _priority = priority;
     Dispatcher = dispatcher;
     Interval = interval;
     Tick += callback;
 }
开发者ID:Mike-EEE,项目名称:Perspex,代码行数:14,代码来源:DispatcherTimer.cs


示例12: InvokeIfRequired

 /// <summary>
 /// for UI methods to switch current thread to UI thread
 /// </summary>
 public static void InvokeIfRequired(this DispatcherObject control, Action methodcall, DispatcherPriority priorityForCall)
 {
     if (control.Dispatcher.Thread != Thread.CurrentThread)
         control.Dispatcher.Invoke(priorityForCall, methodcall);
     else
         methodcall();
 }
开发者ID:saeed-kamyabi,项目名称:EsmFamil,代码行数:10,代码来源:Threading.cs


示例13: Invoke

 public virtual void Invoke(DispatcherPriority priority, Delegate method, object arg)
 {
     if (!this.uiThreadDispatcher.HasShutdownStarted)
     {
         this.uiThreadDispatcher.Invoke(priority, method, arg);
     }
 }
开发者ID:nlh774,项目名称:DotNetReferenceSource,代码行数:7,代码来源:UIThreadDispatcher.cs


示例14: DispatcherOperation

		internal DispatcherOperation (Dispatcher dis, DispatcherPriority prio, Delegate d, object arg)
			: this (dis, prio)
		{
			delegate_method = d;
			delegate_args = new object [1];
			delegate_args [0] = arg;
		}
开发者ID:nobled,项目名称:mono,代码行数:7,代码来源:DispatcherOperation.cs


示例15: BeginInvoke

 public virtual void BeginInvoke(DispatcherPriority priority, Delegate method, object arg, params object[] args)
 {
     if (!this.uiThreadDispatcher.HasShutdownStarted)
     {
         this.uiThreadDispatcher.BeginInvoke(priority, method, arg, args);
     }
 }
开发者ID:nlh774,项目名称:DotNetReferenceSource,代码行数:7,代码来源:UIThreadDispatcher.cs


示例16: DispatchFrame

 public static void DispatchFrame(DispatcherPriority priority = DispatcherPriority.Background)
 {
     DispatcherFrame frame = new DispatcherFrame();
     Dispatcher.CurrentDispatcher.BeginInvoke(priority,
         new DispatcherOperationCallback((f)=>((DispatcherFrame)f).Continue = false), frame);
     Dispatcher.PushFrame(frame);
 }
开发者ID:SonarSource-VisualStudio,项目名称:sonarlint-visualstudio,代码行数:7,代码来源:DispatcherHelper.cs


示例17: Invoke

 public static void Invoke(
     this IDispatcherService dispatcher,
     Action action,
     DispatcherPriority priority
     )
 {
     dispatcher.Invoke(action, priority);
 }
开发者ID:CosminLazar,项目名称:SystemWrapper,代码行数:8,代码来源:DispatcherServiceExtensions.cs


示例18: BeginInvoke

 public static DispatcherOperation BeginInvoke(
     this IDispatcherService dispatcher,
     Action action,
     DispatcherPriority priority
     )
 {
     return dispatcher.BeginInvoke(action, priority);
 }
开发者ID:CosminLazar,项目名称:SystemWrapper,代码行数:8,代码来源:DispatcherServiceExtensions.cs


示例19: DispatcherTimer

 public DispatcherTimer(TimeSpan interval, DispatcherPriority priority,
     EventHandler callback, Dispatcher dispatcher)
 {
     this.priority = priority;
     this.target_dispatcher = dispatcher;
     this.interval = interval.Ticks;
     this.callback = callback;
 }
开发者ID:shahid-pk,项目名称:MonoPresentationFoundation,代码行数:8,代码来源:DispatcherTimer.cs


示例20: DoEvents

 public static void DoEvents(DispatcherPriority nPrio)
 {
     DispatcherFrame nestedFrame = new DispatcherFrame();
     DispatcherOperation exitOperation = Dispatcher.CurrentDispatcher.BeginInvoke(nPrio, exitFrameCallback, nestedFrame);
     Dispatcher.PushFrame(nestedFrame);
     if (exitOperation.Status != DispatcherOperationStatus.Completed)
         exitOperation.Abort();
 }
开发者ID:Slesa,项目名称:Playground,代码行数:8,代码来源:ReportPresenter.cs



注:本文中的DispatcherPriority类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# Display类代码示例发布时间:2022-05-24
下一篇:
C# Dispatcher类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap