예제 #1
0
        public void Subscribe <T>(Action <T> handler, InvokeOption invokeOption, InvokePriority priority, int delay)
        {
            if (!handlers.ContainsKey(typeof(T)))
            {
                handlers[typeof(T)] = new List <SubscriberInfo>();
            }

            handlers[typeof(T)].Add(new SubscriberInfo
            {
                Priority = priority,
                Handler  = new WeakAction(handler),
                Option   = invokeOption,
                Delay    = delay,
            });
        }
        public void BeginInvokeShutdown(InvokePriority priority)
        {
            var dispatcherPriority = (DispatcherPriority)Enum.Parse(typeof(InvokePriority), priority.ToString(), true);

            Application.Current.Dispatcher.BeginInvokeShutdown(dispatcherPriority);
        }
예제 #3
0
 public void Subscribe <T>(Action <T> handler, InvokeOption invokeOption, InvokePriority priority)
 {
     Subscribe(handler, invokeOption, priority, 0);
 }