Ejemplo n.º 1
0
        /// <inheritdoc />
        public void Dispose()
        {
            try
            {
                SystemDb.Instance.Dispose();
                KeyboardHotKeyService.Instance.Dispose();

                foreach (var plugin in Plugins)
                {
                    try
                    {
                        plugin.Dispose();
                    }
                    catch (Exception ex)
                    {
                        LogTo.Error(ex,
                                    "Plugin threw an exception while disposing.");
                    }
                }

                Application.Dispatcher.InvokeShutdown();
            }
            catch (Exception ex)
            {
                LogTo.Error(ex,
                            "Plugin host threw an exception while disposing.");
            }

            Container.Dispose();

            Logger.Instance.Shutdown();
            SentryInstance.Dispose();
        }
Ejemplo n.º 2
0
        public void Dispose()
        {
            HasExited = true;

            CleanupHooks();

            _dataAvailableEvent.Dispose();
            _smProcess.Dispose();

            SentryInstance.Dispose();
        }
Ejemplo n.º 3
0
        public void Run(RemoteHooking.IContext inContext,
                        string channelName)
        {
            try
            {
                try
                {
                    InstallHooks();
                    InstallSM();

                    SMA.OnHookInstalled(true);
                }
                catch (Exception ex)
                {
                    SMA.OnHookInstalled(false,
                                        ex);
                    return;
                }
                finally
                {
                    RemoteHooking.WakeUpProcess();
                }

                DispatchMessages();
            }
            catch (RemotingException)
            {
                // Channel closed, exit.
                SMA = null;
            }
            catch (Exception ex)
            {
                try
                {
                    SMA.OnException(ex);
                }
                catch
                {
                    // ignored
                }
            }
            finally
            {
                HasExited = true;

                CleanupHooks();

                SentryInstance.Dispose();
            }
        }