private void gvResults_CellClick(object sender, DataGridViewCellEventArgs e) { if (e.RowIndex == -1) { var name = this.GetColumnName(e.ColumnIndex); this._currentSortDirection = this._currentSortDirection.Equals(ListSortDirection.Ascending) ? ListSortDirection.Descending : ListSortDirection.Ascending; Utils.SortList <ScanDetails>(ScannerManager.ScanDetails, name, this._currentSortDirection); this.gvResults.DataSource = ScannerManager.ScanDetails; this.gvResults.Invalidate(); } else if (e.RowIndex != -1 && e.ColumnIndex == 0) { var url = this.gvResults.Rows[e.RowIndex].Cells[0].Tag.ToString(); var body = this.gvResults.Rows[e.RowIndex].Cells[this.gvResults.Rows[e.RowIndex].Cells.Count - 3].Value.ToString(); if (!String.IsNullOrEmpty(url) || !String.IsNullOrEmpty(body)) { var dialogResult = MessageBox.Show("Show source in pop up?\n 'No' answer will open related link in default browser ", String.Empty, MessageBoxButtons.YesNoCancel, MessageBoxIcon.Question); if (dialogResult.Equals(DialogResult.Yes)) { var pageBody = new fmPageBody(body); pageBody.Show(); } else if (dialogResult.Equals(DialogResult.No)) { System.Diagnostics.Process.Start(url); } else { MessageBox.Show("This URI is downloadable. Unable to open!", String.Empty, MessageBoxButtons.OK, MessageBoxIcon.Information); } } } }
private void gvResults_CellClick( object sender, DataGridViewCellEventArgs e ) { if( e.RowIndex == -1 ) { var name = this.GetColumnName( e.ColumnIndex ); this._currentSortDirection = this._currentSortDirection.Equals( ListSortDirection.Ascending ) ? ListSortDirection.Descending : ListSortDirection.Ascending; Utils.SortList< ScanDetails >( ScannerManager.ScanDetails, name, this._currentSortDirection ); this.gvResults.DataSource = ScannerManager.ScanDetails; this.gvResults.Invalidate(); } else if( e.RowIndex != -1 && e.ColumnIndex == 0 ) { var url = this.gvResults.Rows[ e.RowIndex ].Cells[ 0 ].Tag.ToString(); var body = this.gvResults.Rows[ e.RowIndex ].Cells[ this.gvResults.Rows[ e.RowIndex ].Cells.Count - 3 ].Value.ToString(); if( !String.IsNullOrEmpty( url ) || !String.IsNullOrEmpty( body ) ) { var dialogResult = MessageBox.Show( "Show source in pop up?\n 'No' answer will open related link in default browser ", String.Empty, MessageBoxButtons.YesNoCancel, MessageBoxIcon.Question ); if( dialogResult.Equals( DialogResult.Yes ) ) { var pageBody = new fmPageBody( body ); pageBody.Show(); } else if( dialogResult.Equals( DialogResult.No ) ) { System.Diagnostics.Process.Start( url ); } else { MessageBox.Show( "This URI is downloadable. Unable to open!", String.Empty, MessageBoxButtons.OK, MessageBoxIcon.Information ); } } } }