void HandleParentChanged(IBrowsableCollection collection) { IPhoto [] local = old; selected_cells.Clear(); bit_array = new BitArray(parent.Count); ClearCached(); if (old != null) { int i; for (i = 0; i < local.Length; i++) { int parent_index = parent.IndexOf(local [i]); if (parent_index >= 0) { Add(parent_index, false); } } } // Call the directly so that we don't reset old immediately this way the old selection // set isn't actually lost until we change it. Changed?.Invoke(this); DetailedChanged?.Invoke(this, null); }
protected void HandleCollectionChanged(IBrowsableCollection collection) { int old_location = Index; int next_location = collection.IndexOf(item); if (old_location == next_location) { if (!Valid(next_location)) { SetIndex(0, null); } return; } if (Valid(next_location)) { SetIndex(next_location); } else if (Valid(old_location)) { SetIndex(old_location); } else { SetIndex(0); } }
public int IndexOf(IPhoto item) { if (collection == null) { return(-1); } return(collection.IndexOf(item)); }
protected void HandleCollectionChanged(IBrowsableCollection browsableCollection) { if (browsableCollection == null) { throw new ArgumentNullException(nameof(browsableCollection)); } int old_location = Index; int next_location = browsableCollection.IndexOf(item); if (old_location == next_location) { if (!Valid(next_location)) { SetIndex(0, null); } return; } if (Valid(next_location)) { SetIndex(next_location); } else if (Valid(old_location)) { SetIndex(old_location); } else if (Valid(old_location - 1)) { SetIndex(old_location - 1); } else { SetIndex(0); } }
protected void HandleCollectionChanged(IBrowsableCollection collection) { if (collection == null) throw new ArgumentNullException ("collection"); int old_location = Index; int next_location = collection.IndexOf (item); if (old_location == next_location) { if (! Valid (next_location)) SetIndex (0, null); return; } if (Valid (next_location)) SetIndex (next_location); else if (Valid (old_location)) SetIndex (old_location); else if (Valid (old_location - 1)) SetIndex (old_location - 1); else SetIndex (0); }
protected void HandleCollectionChanged (IBrowsableCollection collection) { int old_location = Index; int next_location = collection.IndexOf (item); if (old_location == next_location) { if (! Valid (next_location)) SetIndex (0, null); return; } if (Valid (next_location)) SetIndex (next_location); else if (Valid (old_location)) SetIndex (old_location); else SetIndex (0); }