1 write to _owner
System.Windows.Forms (1)
System\Windows\Forms\Controls\ListView\ListView.ListViewNativeItemCollection.cs (1)
19
_owner
= owner;
118 references to _owner
System.Windows.Forms (118)
System\Windows\Forms\Controls\ListView\ListView.ListViewNativeItemCollection.cs (118)
26
_owner
.ApplyUpdateCachedItems();
27
return
_owner
.VirtualMode ?
_owner
.VirtualListSize :
_owner
._itemCount;
31
public bool OwnerIsVirtualListView =>
_owner
.VirtualMode;
33
public bool OwnerIsDesignMode =>
_owner
.DesignMode;
40
_owner
.ApplyUpdateCachedItems();
41
if (
_owner
.VirtualMode)
47
ArgumentOutOfRangeException.ThrowIfGreaterThanOrEqual(displayIndex,
_owner
._itemCount);
49
if (
_owner
.ExpectingMouseUp)
51
_owner
.ItemCollectionChangedInMouseDown = true;
64
_owner
.ApplyUpdateCachedItems();
66
if (
_owner
.VirtualMode)
70
_owner
.OnRetrieveVirtualItem(rVI);
76
rVI.Item.SetItemIndex(
_owner
, index);
82
ArgumentOutOfRangeException.ThrowIfGreaterThanOrEqual(index,
_owner
._itemCount);
84
if (
_owner
.IsHandleCreated && !
_owner
.ListViewHandleDestroyed)
86
_owner
._listItemsTable.TryGetValue(DisplayIndexToID(index), out ListViewItem? item);
91
Debug.Assert(
_owner
._listViewItems is not null, "listItemsArray is null, but the handle isn't created");
92
return
_owner
._listViewItems[index];
99
if (
_owner
.VirtualMode)
105
Debug.Assert(!
_owner
.FlipViewToLargeIconAndSmallIcon || Count == 0, "the FlipView... bit is turned off after adding 1 item.");
112
_owner
.InsertItems(
_owner
._itemCount, [value], true);
114
if (
_owner
.IsHandleCreated && !
_owner
.CheckBoxes && valueChecked)
116
_owner
.UpdateSavedCheckedItems(value, true /*addItem*/);
119
if (
_owner
.ExpectingMouseUp)
121
_owner
.ItemCollectionChangedInMouseDown = true;
132
if (
_owner
.VirtualMode)
137
IComparer? comparer =
_owner
._listItemSorter;
138
_owner
._listItemSorter = null;
140
Debug.Assert(!
_owner
.FlipViewToLargeIconAndSmallIcon || Count == 0, "the FlipView... bit is turned off after adding 1 item.");
144
if (
_owner
.IsHandleCreated && !
_owner
.CheckBoxes)
158
_owner
.BeginUpdate();
159
_owner
.InsertItems(
_owner
._itemCount, values, true);
161
if (
_owner
.IsHandleCreated && !
_owner
.CheckBoxes)
167
_owner
.UpdateSavedCheckedItems(values[i], true /*addItem*/);
174
_owner
._listItemSorter = comparer;
175
_owner
.EndUpdate();
178
if (
_owner
.ExpectingMouseUp)
180
_owner
.ItemCollectionChangedInMouseDown = true;
184
((
_owner
.Sorting != SortOrder.None) && !
_owner
.VirtualMode))
186
_owner
.Sort();
192
Debug.Assert(!
_owner
.VirtualMode, "in virtual mode, this method does not make any sense");
193
if (
_owner
.IsHandleCreated && !
_owner
.ListViewHandleDestroyed)
202
PInvokeCore.SendMessage(
_owner
, PInvoke.LVM_GETITEMW, (WPARAM)0, ref lvItem);
213
if (
_owner
._itemCount <= 0)
218
_owner
.ApplyUpdateCachedItems();
220
if (
_owner
.IsHandleCreated && !
_owner
.ListViewHandleDestroyed)
225
int count =
_owner
.Items.Count;
227
_owner
,
234
ListViewItem item =
_owner
.Items[i];
243
_owner
,
257
Debug.Assert(
_owner
._listViewItems is null, "listItemsArray not null, even though handle created");
259
PInvokeCore.SendMessage(
_owner
, PInvoke.LVM_DELETEALLITEMS);
263
if (
_owner
.View == View.SmallIcon)
267
_owner
.FlipViewToLargeIconAndSmallIcon = true;
271
Debug.Assert(!
_owner
.FlipViewToLargeIconAndSmallIcon, "we only set this when comctl 6.0 is loaded");
272
_owner
.View = View.LargeIcon;
273
_owner
.View = View.SmallIcon;
279
int count =
_owner
.Items.Count;
283
ListViewItem item =
_owner
.Items[i];
287
Debug.Assert(
_owner
._listViewItems is not null, "listItemsArray is null, but the handle isn't created");
288
_owner
._listViewItems.Clear();
291
_owner
._listItemsTable.Clear();
292
if (
_owner
.IsHandleCreated && !
_owner
.CheckBoxes)
294
_owner
._savedCheckedItems = null;
297
_owner
._itemCount = 0;
299
if (
_owner
.ExpectingMouseUp)
301
_owner
.ItemCollectionChangedInMouseDown = true;
307
_owner
.ApplyUpdateCachedItems();
308
if (
_owner
.IsHandleCreated && !
_owner
.ListViewHandleDestroyed)
310
return
_owner
._listItemsTable.TryGetValue(item._id, out ListViewItem? itemOut)
315
Debug.Assert(
_owner
._listViewItems is not null, "listItemsArray is null, but the handle isn't created");
316
return
_owner
._listViewItems.Contains(item);
323
if (
_owner
.VirtualMode)
329
count =
_owner
._itemCount;
335
if (
_owner
.VirtualMode)
340
Debug.Assert(!
_owner
.FlipViewToLargeIconAndSmallIcon || Count == 0, "the FlipView... bit is turned off after adding 1 item.");
345
_owner
.ApplyUpdateCachedItems();
348
_owner
.InsertItems(index, [item], true);
349
if (
_owner
.IsHandleCreated && !
_owner
.CheckBoxes && item.Checked)
351
_owner
.UpdateSavedCheckedItems(item, true /*addItem*/);
354
if (
_owner
.ExpectingMouseUp)
356
_owner
.ItemCollectionChangedInMouseDown = true;
364
Debug.Assert(!
_owner
.VirtualMode, "in virtual mode, this function does not make any sense");
378
int index =
_owner
.VirtualMode ? Count - 1 : IndexOf(item);
380
Debug.Assert(!
_owner
.FlipViewToLargeIconAndSmallIcon || Count == 0, "the FlipView... bit is turned off after adding 1 item.");
382
if (
_owner
.VirtualMode)
395
if (
_owner
.VirtualMode)
401
ArgumentOutOfRangeException.ThrowIfGreaterThanOrEqual(index,
_owner
._itemCount);
403
Debug.Assert(!
_owner
.FlipViewToLargeIconAndSmallIcon || Count == 0, "the FlipView... bit is turned off after adding 1 item.");
405
if (
_owner
.IsHandleCreated && !
_owner
.CheckBoxes && this[index].Checked)
407
_owner
.UpdateSavedCheckedItems(this[index], addItem: false);
410
_owner
.ApplyUpdateCachedItems();
416
if (
_owner
.IsHandleCreated)
418
Debug.Assert(
_owner
._listViewItems is null, "listItemsArray not null, even though handle created");
419
if (PInvokeCore.SendMessage(
_owner
, PInvoke.LVM_DELETEITEM, (WPARAM)index) == 0)
426
Debug.Assert(
_owner
._listViewItems is not null, "listItemsArray is null, but the handle isn't created");
427
_owner
._listViewItems.RemoveAt(index);
430
_owner
._itemCount--;
431
_owner
._listItemsTable.Remove(itemID);
433
if (
_owner
.ExpectingMouseUp)
435
_owner
.ItemCollectionChangedInMouseDown = true;
441
if (
_owner
._itemCount > 0)
452
ListViewItem[] items = new ListViewItem[
_owner
._itemCount];