예제 #1
0
파일: App.cs 프로젝트: Jlow0214/ffxivapp
 /// <summary>
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void OnUnhandledExceptionFilter(object sender, DispatcherUnhandledExceptionFilterEventArgs e)
 {
     e.RequestCatch = true;
     var ex = e.Exception;
     Logging.Log(Logger, new LogItem("", ex, LogLevel.Error));
 }
예제 #2
0
파일: App.cs 프로젝트: Catacatata/ffxivapp
 /// <summary>
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void DispatcherOnUnhandledExceptionFilter(object sender, DispatcherUnhandledExceptionFilterEventArgs e)
 {
     e.RequestCatch = true;
     MessageBox.Show(e.Exception.Message);
 }
예제 #3
0
        private Dispatcher() 
        {
            _queue = new PriorityQueue<DispatcherOperation>(); 
 
            _tlsDispatcher = this; // use TLS for ownership only
            _dispatcherThread = Thread.CurrentThread; 

            // Add ourselves to the map of dispatchers to threads.
            lock(_globalLock)
            { 
                _dispatchers.Add(new WeakReference(this));
            } 
 
            _unhandledExceptionEventArgs = new DispatcherUnhandledExceptionEventArgs(this);
            _exceptionFilterEventArgs = new DispatcherUnhandledExceptionFilterEventArgs(this); 

            _dispatcherSynchronizationContext = new DispatcherSynchronizationContext(this);

            // Create the message-only window we use to receive messages 
            // that tell us to process the queue.
            MessageOnlyHwndWrapper window = new MessageOnlyHwndWrapper(); 
            _window = new SecurityCriticalData<MessageOnlyHwndWrapper>( window ); 

            _hook = new HwndWrapperHook(WndProcHook); 
            _window.Value.AddHook(_hook);
        }