public ObjectSubtype AddObjectSubType([NotNull] ObjectSubtype objectSubtype) { Assert.ArgumentNotNull(objectSubtype, nameof(objectSubtype)); Assert.ArgumentCondition(Equals(objectSubtype.ObjectType), "ObjectSubtype does not belong to this ObjectType"); int index = _objectSubtypes.Count; _objectSubtypes.Add(objectSubtype); objectSubtype.SortOrder = index; return(objectSubtype); }
public ObjectSubtype AddObjectSubType([NotNull] string name, [NotNull] ObjectAttribute attribute, [CanBeNull] object attributeValue, VariantValueType valueType = VariantValueType.Null) { Assert.ArgumentNotNullOrEmpty(name, nameof(name)); Assert.ArgumentNotNull(attribute, nameof(attribute)); ObjectSubtype objectSubtype = AddObjectSubType(name); objectSubtype.AddCriterion(attribute, attributeValue, valueType); return(objectSubtype); }
public ObjectSubtype AddObjectSubType([CanBeNull] string name = null) { var objectSubtype = new ObjectSubtype(this, name); return(AddObjectSubType(objectSubtype)); }
// TODO move up / move down methods on _objectSubtypes (modify SortOrder) public bool RemoveObjectSubtype([NotNull] ObjectSubtype objectSubtype) { Assert.ArgumentNotNull(objectSubtype, nameof(objectSubtype)); return(_objectSubtypes.Remove(objectSubtype)); }