示例#1
0
        private void StartRendering()
        {
            // Spin up DX handling from the plugin interface
            DxHandler.Initialise(pluginInterface);

            // Spin up WndProc hook
            WndProcHandler.Initialise(DxHandler.WindowHandle);
            WndProcHandler.WndProcMessage += OnWndProc;

            // Boot the render process. This has to be done before initialising settings to prevent a
            // race conditionson inlays recieving a null reference.
            var pid = Process.GetCurrentProcess().Id;

            renderProcess          = new RenderProcess(pid, pluginDir, dependencyManager);
            renderProcess.Recieve += HandleIpcRequest;
            renderProcess.Start();

            // Prep settings
            settings                   = new Settings(pluginInterface);
            settings.InlayAdded       += OnInlayAdded;
            settings.InlayNavigated   += OnInlayNavigated;
            settings.InlayDebugged    += OnInlayDebugged;
            settings.InlayRemoved     += OnInlayRemoved;
            settings.TransportChanged += OnTransportChanged;
            settings.Initialise();
        }
示例#2
0
        public void Dispose()
        {
            foreach (var inlay in inlays.Values)
            {
                inlay.Dispose();
            }
            inlays.Clear();

            renderProcess?.Dispose();

            settings?.Dispose();

            WndProcHandler.Shutdown();
            DxHandler.Shutdown();

            pluginInterface.Dispose();

            dependencyManager.Dispose();
        }