BolterV2.MainWindow.Refresh C# (CSharp) 메소드

Refresh() 개인적인 메소드

private Refresh ( object sender, RoutedEventArgs e ) : void
sender object
e System.Windows.RoutedEventArgs
리턴 void
        private void Refresh(object sender, RoutedEventArgs e)
        {
            if (ProcessListBox != null && ProcessListBox.Items.Count > 0)
            {
                ProcessListBox.SelectionChanged -= ProcessListBox_OnSelectionChanged;
                ProcessListBox.Items.Clear();
                ProcessListBox.SelectionChanged += ProcessListBox_OnSelectionChanged;
            }
            _pidMenu = true;
            if (DebugButton != null)
                DebugButton.Visibility = Visibility.Hidden;

            var ThePs = Process.GetProcessesByName("ffxiv");
            foreach (var process in ThePs)
            {
                var hProc = process.Handle;
                var sigScam = new SigScan(process, process.MainModule.BaseAddress + 0xFB9000, 0x14B000);
                byte[] playerStructSig = { 0x46, 0x69, 0x72, 0x65, 0x20, 0x53, 0x68, 0x61, 0x72, 0x64, 0x02, 0x13, 0x02, 0xEC, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00 };
                var NamePtr = sigScam.FindPattern(playerStructSig, "xxxxxxxxxxxxxxxxxxxx", -(int)process.MainModule.BaseAddress) - 0xC26;
                playerName =
                    Encoding.ASCII.GetString(_mapper.ReadMemory(
                        hProc, process.MainModule.BaseAddress + (int)NamePtr, 21).TakeWhile(p => p != 0).ToArray());

                var newimg = (ImageSource)CreateBitmapSourceFromBitmap(Properties.Resources.ffxiv);
                ProcessListBox.Items.Add(new ListImg(string.Format("{0}\nPID - {1}", playerName, process.Id), newimg));
            }
        }