コード例 #1
0
        private void DoWorkBackground(object sender, DoWorkEventArgs e)
        {
            BackgroundWorker worker           = sender as BackgroundWorker;
            WPFOverlay       PrimePartOverlay = (WPFOverlay)overlay;

            Application.Current.Dispatcher.Invoke(delegate
            {
                PrimePartOverlay.Enable();
            });

            while (!worker.CancellationPending)
            {
                Application.Current.Dispatcher.Invoke(delegate
                {
                    overlay.Update();
                });
            }

#if DEBUG
            Console.WriteLine("Worker Exiting");
#endif
            Application.Current.Dispatcher.Invoke(delegate
            {
                PrimePartOverlay.Disable();
            });

            return;
        }
コード例 #2
0
        public async void Close()
        {
            if (RenderOverlay && backgroundWorker.IsBusy)
            {
                backgroundWorker.CancelAsync();
            }

            WPFOverlay wpfoverlay = (WPFOverlay)overlay;

            if (wpfoverlay != null)
            {
                wpfoverlay.Dispose();
            }
            (await PrimeData.GetInstance().ConfigureAwait(false)).SaveToFile();
        }
コード例 #3
0
        private void StartRenderOverlayPrimes()
        {
            if (overlay == null)
            {
                overlay = new WPFOverlay();
            }

            if (WarframeProcess == null)
            {
                WarframeProcess = new ProcessSharp(Warframe.GetProcess(), MemoryType.Remote);
            }

            if (WarframeProcess != null)
            {
                WPFOverlay wpfoverlay = (WPFOverlay)overlay;

                if (!wpfoverlay.Initialized)
                {
                    wpfoverlay.Initialize(WarframeProcess.WindowFactory.MainWindow);
                }

                wpfoverlay.UpdatePrimesData(detectedPrimePartsList);
            }
        }