4 writes to CurrencyManager
System.Windows.Forms (4)
System\Windows\Forms\Controls\DataGridView\DataGridView.DataConnection.cs (4)
906CurrencyManager = null; 1075CurrencyManager = null; 1079CurrencyManager = _owner.BindingContext[DataSource, DataMember] as CurrencyManager; 1084CurrencyManager = null;
84 references to CurrencyManager
System.Windows.Forms (84)
System\Windows\Forms\Controls\DataGridView\DataGridView.DataConnection.cs (73)
88return CurrencyManager is { List: IBindingList { SupportsChangeNotification: true }, AllowAdd: true }; 92public bool AllowEdit => CurrencyManager is not null && CurrencyManager.AllowEdit; 99return CurrencyManager is { AllowRemove: true, List: IBindingList { SupportsChangeNotification: true } }; 120public IList? List => CurrencyManager?.List; 155if (CurrencyManager is not null) 158if (!CurrencyManager.ShouldBind) 163Debug.Assert(CurrencyManager.AllowAdd, "why did we call AddNew on the currency manager when the currency manager does not allow new rows?"); 169CurrencyManager.EndCurrentEdit(); 180CurrencyManager.AddNew(); 209if (CurrencyManager is null) 302if (CurrencyManager?.List is not IBindingList { SupportsSorting: true, IsSorted: true }) 341Debug.Assert(DataBoundRowsCount() == CurrencyManager!.List!.Count || (_owner.Columns.Count == 0 && dataGridViewRowsCount == 0), 348Debug.Assert(sender == CurrencyManager, "did we forget to unregister our ListChanged event handler?"); 362_lastListCount = CurrencyManager!.Count; 442while (DataBoundRowsCount() < CurrencyManager!.Count); 474Debug.Assert(CurrencyManager?.List is not null); 475if (_dataConnectionState[DATACONNECTIONSTATE_inDeleteOperation] && CurrencyManager.List.Count == 0) 492Debug.Assert(CurrencyManager?.List is not null); 494&& CurrencyManager.List.Count == (_owner.AllowUserToAddRowsInternal ? _owner.Rows.Count - 1 : _owner.Rows.Count)) 508Debug.Assert(CurrencyManager.List.Count == 1); 529Debug.Assert(CurrencyManager!.List!.Count == 0, "we deleted the row that the Child table forcefully added"); 551Debug.Assert(CurrencyManager?.List is not null); 552if (CurrencyManager.List.Count == DataBoundRowsCount()) 678Debug.Assert(sender == CurrencyManager, "did we forget to unregister our events?"); 718CurrencyManager!.Position > -1 && // condition 3. 719CurrencyManager.Position == _owner.NewRowIndex && // condition 4. 721CurrencyManager.Count == DataBoundRowsCount() + 1) // condition 6. 736Debug.Assert(CurrencyManager?.List is not null); 737if (CurrencyManager.List is IBindingList ibl && ibl.SupportsSorting && ibl.IsSorted) 747clearSelection |= _lastListCount == -1 || _lastListCount == CurrencyManager!.Count; 798Debug.Assert(CurrencyManager is not null); 805Debug.Assert(CurrencyManager is not null); 808_props = CurrencyManager.GetItemProperties(); 828Debug.Assert(CurrencyManager?.List is not null); 829if (_owner.NewRowIndex == CurrencyManager.List.Count) 837Debug.Assert(_owner.NewRowIndex == CurrencyManager.List.Count - 1); 854CurrencyManager.RemoveAt(rowIndex); 871CurrencyManager!.RemoveAt(rowIndex); 974if (CurrencyManager?.List is not IBindingList { SupportsSorting: true, IsSorted: true } ibl) 1022if (CurrencyManager is not null) 1089if (CurrencyManager is not null) 1091_props = CurrencyManager.GetItemProperties(); 1105if (CurrencyManager is not null) 1107_lastListCount = CurrencyManager.Count; 1120errInfo = CurrencyManager![rowIndex] as IDataErrorInfo; 1146errInfo = CurrencyManager![rowIndex] as IDataErrorInfo; 1178value = _props![boundColumnIndex].GetValue(CurrencyManager![rowIndex]); 1227int rowIndex = CurrencyManager!.Position; 1291if (CurrencyManager!.Position >= 0 && CurrencyManager.Position < CurrencyManager.List!.Count) 1293currentItem = CurrencyManager.Current; 1296CurrencyManager.CancelCurrentEdit(); 1304if (CurrencyManager.Position >= 0 && CurrencyManager.Position < CurrencyManager.List!.Count) 1306editableObject = CurrencyManager.Current as IEditableObject; 1347if (!CurrencyManager!.ShouldBind) 1358&& CurrencyManager.Position != e.RowIndex) 1362CurrencyManager.Position = e.RowIndex; 1370if (CurrencyManager.Current is IEditableObject iEditObj) 1385if (!CurrencyManager!.ShouldBind) 1394Debug.Assert(DataBoundRowsCount() == CurrencyManager.List!.Count, "if the back end was changed while in AddNew the DGV should have updated its rows collection"); 1415CurrencyManager.EndCurrentEdit(); 1450if (CurrencyManager!.Current is IEditableObject iEditObj) 1490_props![boundColumnIndex].SetValue(CurrencyManager![rowIndex], value); 1548if (CurrencyManager is not null) 1550CurrencyManager.PositionChanged -= currencyManager_PositionChanged; 1551CurrencyManager.ListChanged -= currencyManager_ListChanged; 1558if (CurrencyManager is not null) 1560CurrencyManager.PositionChanged += currencyManager_PositionChanged; 1561CurrencyManager.ListChanged += currencyManager_ListChanged;
System\Windows\Forms\Controls\DataGridView\DataGridView.Methods.cs (7)
3356if ((DataConnection.CurrencyManager?.Count ?? 0) <= _ptCurrentCell.Y) 11481if (DataConnection.CurrencyManager is not null) 14781Debug.Assert(DataConnection.CurrencyManager is not null); 14782Debug.Assert(DataConnection.CurrencyManager.Position == _ptCurrentCell.Y); 14880if (DataConnection is not null && DataConnection.CurrencyManager is not null) 14892if (DataConnection is not null && DataConnection.CurrencyManager is not null) 19956int rowCount = DataConnection!.CurrencyManager?.List.Count ?? 0;
System\Windows\Forms\Controls\DataGridView\DataGridViewCell.cs (2)
2441else if ((dataConnection.CurrencyManager?.Count ?? 0) <= rowIndex) 3889else if ((dataConnection.CurrencyManager?.Count ?? 0) <= rowIndex)
System\Windows\Forms\Controls\DataGridView\DataGridViewRow.cs (2)
72&& DataGridView.DataConnection.CurrencyManager is not null 76return DataGridView.DataConnection.CurrencyManager[Index];