public bool TryRemove(T value, out FrugalList <T> result) { int count = Count; result = Remove(value); return(result.Count < count); }
internal void CopyAnnotationsFrom(FrugalList <object> other) { _annotations = other.Clone(); foreach (var anno in _annotations.OfType <IDomObjectReferenceLifecycle>()) { anno.Attaching(this); } }
public DomObject RemoveAnnotations(Type type) { if (type == null) { throw new ArgumentNullException(nameof(type)); } _annotations = _annotations.RemoveOfType(type, DetachLifecycle); return(this); }
public DomObject AddAnnotation(object annotation) { if (annotation == null) { throw new ArgumentNullException(nameof(annotation)); } if (annotation is IDomObjectReferenceLifecycle cl) { cl.Attaching(this); } _annotations = _annotations.Add(annotation); return(this); }
public DomObject RemoveAnnotation(object value) { if (value == null) { throw new ArgumentNullException(nameof(value)); } if (value is IDomObjectReferenceLifecycle cl) { cl.Detaching(); } _annotations = _annotations.Remove(value); return(this); }
internal Grouping(TKey key, FrugalList <DomElement> items) { _items = items; _key = key; }
public DomObject RemoveAnnotations <T>() where T : class { _annotations = _annotations.RemoveOfType(typeof(T), DetachLifecycle); return(this); }