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];
246
_owner
,
259
Debug.Assert(
_owner
._listViewItems is null, "listItemsArray not null, even though handle created");
261
PInvokeCore.SendMessage(
_owner
, PInvoke.LVM_DELETEALLITEMS);
265
if (
_owner
.View == View.SmallIcon)
269
_owner
.FlipViewToLargeIconAndSmallIcon = true;
273
Debug.Assert(!
_owner
.FlipViewToLargeIconAndSmallIcon, "we only set this when comctl 6.0 is loaded");
274
_owner
.View = View.LargeIcon;
275
_owner
.View = View.SmallIcon;
281
int count =
_owner
.Items.Count;
285
ListViewItem item =
_owner
.Items[i];
289
Debug.Assert(
_owner
._listViewItems is not null, "listItemsArray is null, but the handle isn't created");
290
_owner
._listViewItems.Clear();
293
_owner
._listItemsTable.Clear();
294
if (
_owner
.IsHandleCreated && !
_owner
.CheckBoxes)
296
_owner
._savedCheckedItems = null;
299
_owner
._itemCount = 0;
301
if (
_owner
.ExpectingMouseUp)
303
_owner
.ItemCollectionChangedInMouseDown = true;
309
_owner
.ApplyUpdateCachedItems();
310
if (
_owner
.IsHandleCreated && !
_owner
.ListViewHandleDestroyed)
312
return
_owner
._listItemsTable.TryGetValue(item._id, out ListViewItem? itemOut)
317
Debug.Assert(
_owner
._listViewItems is not null, "listItemsArray is null, but the handle isn't created");
318
return
_owner
._listViewItems.Contains(item);
325
if (
_owner
.VirtualMode)
331
count =
_owner
._itemCount;
337
if (
_owner
.VirtualMode)
342
Debug.Assert(!
_owner
.FlipViewToLargeIconAndSmallIcon || Count == 0, "the FlipView... bit is turned off after adding 1 item.");
347
_owner
.ApplyUpdateCachedItems();
350
_owner
.InsertItems(index, [item], true);
351
if (
_owner
.IsHandleCreated && !
_owner
.CheckBoxes && item.Checked)
353
_owner
.UpdateSavedCheckedItems(item, true /*addItem*/);
356
if (
_owner
.ExpectingMouseUp)
358
_owner
.ItemCollectionChangedInMouseDown = true;
366
Debug.Assert(!
_owner
.VirtualMode, "in virtual mode, this function does not make any sense");
380
int index =
_owner
.VirtualMode ? Count - 1 : IndexOf(item);
382
Debug.Assert(!
_owner
.FlipViewToLargeIconAndSmallIcon || Count == 0, "the FlipView... bit is turned off after adding 1 item.");
384
if (
_owner
.VirtualMode)
397
if (
_owner
.VirtualMode)
403
ArgumentOutOfRangeException.ThrowIfGreaterThanOrEqual(index,
_owner
._itemCount);
405
Debug.Assert(!
_owner
.FlipViewToLargeIconAndSmallIcon || Count == 0, "the FlipView... bit is turned off after adding 1 item.");
407
if (
_owner
.IsHandleCreated && !
_owner
.CheckBoxes && this[index].Checked)
409
_owner
.UpdateSavedCheckedItems(this[index], addItem: false);
412
_owner
.ApplyUpdateCachedItems();
418
if (
_owner
.IsHandleCreated)
420
Debug.Assert(
_owner
._listViewItems is null, "listItemsArray not null, even though handle created");
421
if (PInvokeCore.SendMessage(
_owner
, PInvoke.LVM_DELETEITEM, (WPARAM)index) == 0)
428
Debug.Assert(
_owner
._listViewItems is not null, "listItemsArray is null, but the handle isn't created");
429
_owner
._listViewItems.RemoveAt(index);
432
_owner
._itemCount--;
433
_owner
._listItemsTable.Remove(itemID);
435
if (
_owner
.ExpectingMouseUp)
437
_owner
.ItemCollectionChangedInMouseDown = true;
443
if (
_owner
._itemCount > 0)
454
ListViewItem[] items = new ListViewItem[
_owner
._itemCount];