Пример #1
0
        public GSDumpGUI()
        {
            PortableXmlSettingsProvider.ApplyProvider(Settings);

            InitializeComponent();
            _internalLogger           = new RichTextBoxLogger(txtIntLog);
            _gsdxLogger               = new RichTextBoxLogger(txtLog);
            _gsdxDllFinder            = new GsdxDllFinder(_internalLogger);
            _gsDumpFinder             = new GsDumpFinder(_internalLogger);
            _folderWithFallBackFinder = new FolderWithFallBackFinder();
            _availableGsDumps         = new GsDumps();
            _availableGsDlls          = new GsDlls();

            _availableGsDumps.OnIndexUpdatedEvent += UpdatePreviewImage;

            txtGSDXDirectory.DataBindings.Add(nameof(TextBox.Text), Settings, nameof(Settings.GSDXDir));
            txtDumpsDirectory.DataBindings.Add(nameof(TextBox.Text), Settings, nameof(Settings.DumpDir));

            BindListControl(lstDumps, _availableGsDumps, g => g.Files, f => f.DisplayText, g => g.SelectedFileIndex);
            BindListControl(lstGSDX, _availableGsDlls, g => g.Files, f => f.DisplayText, g => g.SelectedFileIndex);

            Processes = new List <Process>();

            NoImage = CreateDefaultImage();
        }
Пример #2
0
        public GSDumpGUI()
        {
            PortableXmlSettingsProvider.ApplyProvider(Settings);

            InitializeComponent();
            _internalLogger           = new RichTextBoxLogger(txtIntLog);
            _gsdxLogger               = new RichTextBoxLogger(txtLog);
            _gsdxDllFinder            = new GsdxDllFinder(_internalLogger);
            _gsDumpFinder             = new GsDumpFinder(_internalLogger);
            _folderWithFallBackFinder = new FolderWithFallBackFinder();
            _availableGsDumps         = new GsDumps();
            _availableGsDlls          = new GsDlls();

            _availableGsDumps.OnIndexUpdatedEvent += UpdatePreviewImage;

            this.Text += Environment.Is64BitProcess ? " 64bits" : " 32bits";

            if (String.IsNullOrEmpty(Settings.GSDXDir) || !Directory.Exists(Settings.GSDXDir))
            {
                Settings.GSDXDir = AppDomain.CurrentDomain.BaseDirectory;
            }

            if (String.IsNullOrEmpty(Settings.DumpDir) || !Directory.Exists(Settings.DumpDir))
            {
                Settings.DumpDir = AppDomain.CurrentDomain.BaseDirectory;
            }

            txtGSDXDirectory.Text  = Settings.GSDXDir;
            txtDumpsDirectory.Text = Settings.DumpDir;

            BindListControl(lstDumps, _availableGsDumps, g => g.Files, f => f.DisplayText, g => g.SelectedFileIndex);
            BindListControl(lstGSDX, _availableGsDlls, g => g.Files, f => f.DisplayText, g => g.SelectedFileIndex);

            Processes = new List <Process>();

            NoImage = CreateDefaultImage();

            _dllWatcher    = new List <FileSystemWatcher>();
            _dumpWatcher   = new List <FileSystemWatcher>();
            _watcherEvents = new ConcurrentQueue <FileChangeEvt>();

            _fileChangesWatchdog          = new System.Windows.Forms.Timer();
            _fileChangesWatchdog.Tick    += new EventHandler(FileChangesWatchdog);
            _fileChangesWatchdog.Interval = 1000;
            _fileChangesWatchdog.Start();
        }