public void Remove( GuiObject obj ) { if( !obj.selected ) throw new ArgumentException( "item is not from the collection" ); obj.selected = false; obj.SelectionChanged(); obj.Invalidate(); objs.Remove( obj ); }
public void Remove(GuiObject obj) { if (!obj.selected) { throw new ArgumentException("item is not from the collection"); } obj.selected = false; obj.SelectionChanged(); obj.Invalidate(); objs.Remove(obj); }
public int Add( GuiObject value ) { if( objs.Contains( value ) ) return 0; if( value == null || value.selected ) throw new ArgumentException( "wrong item for collection" ); value.selected = true; value.SelectionChanged(); value.Invalidate(); return objs.Add( value ); }
public int Add(GuiObject value) { if (objs.Contains(value)) { return(0); } if (value == null || value.selected) { throw new ArgumentException("wrong item for collection"); } value.selected = true; value.SelectionChanged(); value.Invalidate(); return(objs.Add(value)); }