示例#1
0
 private bool SelectDownloadRowInternal(DownloadRow row, bool callAfterSort = false)
 {
     if (row != null)
     {
         var visibleIndex = row.GetVisibleIndex();
         if ((0 <= visibleIndex) && (visibleIndex < DGV.RowCount))
         {
             var dtrow = DGV.Rows[visibleIndex];
             if (dtrow.Selected)
             {
                 SelectionChanged?.Invoke(row);
             }
             else
             {
                 dtrow.Selected = true;
             }
             if (!callAfterSort)
             {
                 _UserMade_DGV_SelectionChanged = false;
             }
             return(true);
         }
     }
     return(false);
 }
示例#2
0
        private void Model_RowPropertiesChanged(DownloadRow row, string propertyName)
        {
            var visibleIndex = row.GetVisibleIndex();

            if ((0 <= visibleIndex) && (visibleIndex < DGV.RowCount))
            {
                DGV.InvalidateRow(visibleIndex);

                if (propertyName == nameof(DownloadRow.Status))
                {
                    RestoreSortIfNeed();
                }
            }
        }