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