// todo: move commonly reused code to base class's constructor public Gen3Searcher(Gen3SearchParams searchParams, object threadLock, Form caller) { this.searchParams = searchParams; this.threadLock = threadLock; this.caller = caller; numThreads = 1; waitHandle = new EventWaitHandle(true, EventResetMode.ManualReset); captureFrames = new List <Gen3CapFrame>(); frameBinding = new BindingSource { DataSource = captureFrames }; searchParams.dataGridView.DataSource = frameBinding; btnGenerate = searchParams.capButton; }
private void buttonCapGenerate_Click(object sender, EventArgs e) { var searchParams = new Gen3SearchParams { ability = cbAbility, capButton = btnCapGenerate, dataGridView = dgvCapValues, date = dtSeed, encounterSlot = cbEncounterSlot, encounterType = cbEncounterType, frameType = cbMethod, gender = cbCapGender, id = txtID, isShiny = chkShinyOnly, isSynch = chkSynchOnly, ivfilters = ivFiltersCapture, maxFrame = txtCapMaxFrame, maxHour = txtMaxHour, maxMinute = txtMaxMinute, minFrame = txtCapMinFrame, minHour = txtMinHour, minMinute = txtMinMinute, nature = cbNature, sid = txtSID, synchNature = cbSynchNature }; Searcher searcher = new Gen3Searcher(searchParams, threadLock, this); if (!searcher.ParseInput()) return; searcher.RunSearch(); }
// todo: move commonly reused code to base class's constructor public Gen3Searcher(Gen3SearchParams searchParams, object threadLock, Form caller) { this.searchParams = searchParams; this.threadLock = threadLock; this.caller = caller; numThreads = 1; waitHandle = new EventWaitHandle(true, EventResetMode.ManualReset); captureFrames = new List<Gen3CapFrame>(); frameBinding = new BindingSource {DataSource = captureFrames}; searchParams.dataGridView.DataSource = frameBinding; btnGenerate = searchParams.capButton; }