Example #1
0
		public void BeginInvoke(DispatcherPrio priority, Action method) {
			// Don't call method() here if disp.CheckAccess() is true. That could lead to some
			// problems, eg. a file gets removed, the BP list gets saved and a file gets added,
			// causing an exception.
			if (disp.HasShutdownFinished || disp.HasShutdownStarted)
				method();
			else
				disp.BeginInvoke(Convert(priority), method);
		}
Example #2
0
		DispatcherPriority Convert(DispatcherPrio priority) {
			switch (priority) {
			case DispatcherPrio.ContextIdle: return DispatcherPriority.ContextIdle;
			case DispatcherPrio.Background: return DispatcherPriority.Background;
			case DispatcherPrio.Loaded: return DispatcherPriority.Loaded;
			case DispatcherPrio.Send: return DispatcherPriority.Send;
			default:
				Debug.Fail("Unknown prio");
				return DispatcherPriority.Background;
			}
		}
Example #3
0
 public void BeginInvoke(DispatcherPrio priority, Action method)
 {
     // Don't call method() here if disp.CheckAccess() is true. That could lead to some
     // problems, eg. a file gets removed, the BP list gets saved and a file gets added,
     // causing an exception.
     if (disp.HasShutdownFinished || disp.HasShutdownStarted)
     {
         method();
     }
     else
     {
         disp.BeginInvoke(Convert(priority), method);
     }
 }
Example #4
0
        DispatcherPriority Convert(DispatcherPrio priority)
        {
            switch (priority)
            {
            case DispatcherPrio.ContextIdle: return(DispatcherPriority.ContextIdle);

            case DispatcherPrio.Background: return(DispatcherPriority.Background);

            case DispatcherPrio.Loaded: return(DispatcherPriority.Loaded);

            case DispatcherPrio.Send: return(DispatcherPriority.Send);

            default:
                Debug.Fail("Unknown prio");
                return(DispatcherPriority.Background);
            }
        }
Example #5
0
			public void BeginInvoke(DispatcherPrio priority, Action method) {
				method();
			}
Example #6
0
 public void BeginInvoke(DispatcherPrio priority, Action method)
 {
     method();
 }