protected ClearAll ( IReorderableListAdaptor adaptor ) : bool | ||
adaptor | IReorderableListAdaptor | Reorderable list adaptor. |
return | bool |
protected bool ClearAll(IReorderableListAdaptor adaptor)
{
if (adaptor.Count == 0)
return true;
var args = new ItemRemovingEventArgs(adaptor, 0);
int count = adaptor.Count;
for (int i = 0; i < count; ++i) {
args.ItemIndex = i;
OnItemRemoving(args);
if (args.Cancel)
return false;
}
adaptor.Clear();
GUI.changed = true;
ReorderableListGUI.IndexOfChangedItem = -1;
return true;
}