/* private void dgvSearchResults_CellDoubleClick(object sender, DataGridViewCellEventArgs e) * { * dgvSearchResults_SelectionChanged(null, null); * }*/ private void dgvSearchResults_SelectionChanged(object sender, EventArgs e) { if (cbOpenSelectedItemInMainGUIWindow.Checked && dgvSearchResults.SelectedRows.Count == 1) { var tsrSearchResult = (TextSearchResult)dgvSearchResults.SelectedRows[0].Tag; if (tsrSearchResult != null) { O2Messages.fileOrFolderSelected(tsrSearchResult.sFile, tsrSearchResult.iLineNumber + 1); //asceSourceCodeEditor.gotoLine(tsrSearchResult.sFile, tsrSearchResult.iLineNumber + 1); O2Thread.mtaThread( () => { Thread.Sleep(200); var searchResultsForm = O2Forms.findParentThatHostsControl(this); //var searchResultsForm = O2DockUtils.getO2DockContentForm("Search Results"); searchResultsForm.invokeOnThread( () => { searchResultsForm.Focus(); dgvSearchResults.Focus(); }); // DI.dO2LoadedO2DockContent[name].dockContent.invokeOnThread( // () => { DI.dO2LoadedO2DockContent[name].dockContent.Focus(); }); }); } } }
public void removeTaskFromParentControl(int secondsToWait) { if (Parent != null) { if (Parent.InvokeRequired) { Parent.Invoke(new EventHandler((sender, e) => removeTaskFromParentControl(secondsToWait))); } else { Thread.Sleep(1000 * 1); Control parentControl = O2Forms.findParentThatHostsControl(this); if (parentControl != null) { parentControl.Controls.Remove(this); } } } }